From 2fe1d02b7ae6ea2542fb68444a3929083c12e2ca Mon Sep 17 00:00:00 2001 From: David Date: Fri, 8 Feb 2019 18:16:08 +0100 Subject: [PATCH] [MIG] pos_payment_entries_globalization: Migration to 11.0 --- pos_payment_entries_globalization/README.rst | 81 +++++++++++++------ .../__manifest__.py | 5 +- pos_payment_entries_globalization/i18n/es.po | 59 ++++++++++++++ .../pos_payment_entries_globalization.pot | 60 ++++++++++++++ .../models/account_journal.py | 1 - .../models/pos_session.py | 8 +- .../readme/CONFIGURE.rst | 7 ++ .../readme/CONTRIBUTORS.rst | 6 ++ .../readme/DESCRIPTION.rst | 5 ++ .../readme/USAGE.rst | 1 + .../test_pos_payment_entries_globalization.py | 1 - .../views/account_journal_view.xml | 2 +- 12 files changed, 203 insertions(+), 33 deletions(-) create mode 100644 pos_payment_entries_globalization/i18n/es.po create mode 100644 pos_payment_entries_globalization/i18n/pos_payment_entries_globalization.pot create mode 100644 pos_payment_entries_globalization/readme/CONFIGURE.rst create mode 100644 pos_payment_entries_globalization/readme/CONTRIBUTORS.rst create mode 100644 pos_payment_entries_globalization/readme/DESCRIPTION.rst create mode 100644 pos_payment_entries_globalization/readme/USAGE.rst diff --git a/pos_payment_entries_globalization/README.rst b/pos_payment_entries_globalization/README.rst index 78da450c..5cf231c1 100644 --- a/pos_payment_entries_globalization/README.rst +++ b/pos_payment_entries_globalization/README.rst @@ -1,63 +1,98 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html - :alt: License: AGPL-3 - ================================= POS payment entries globalization ================================= +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpos-lightgray.png?logo=github + :target: https://github.com/OCA/pos/tree/11.0/pos_payment_entries_globalization + :alt: OCA/pos +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/pos-11-0/pos-11-0-pos_payment_entries_globalization + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/184/11.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + This module allows to globalize payment entries created by the POS. -In some cases, all banking transactions are received in a single bank statement line. -With this module, it's possible to reconcile this one line with the payment globalization line. +In some cases, all banking transactions are received in a single bank statement +line. With this module, it's possible to reconcile this one line with the +payment globalization line. +**Table of contents** + +.. contents:: + :local: Configuration ============= To configure this module, you need to: - * Configure globalize account and journal on POS payment methods (Account journal). + * Configure globalize account and journal on POS payment methods + (Account journal). -A globalization entry is generated for each globalization journal and each globalization account defined on payment methods. +A globalization entry is generated for each globalization journal and each +globalization account defined on payment methods. Usage ===== -.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas - :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/184/10.0 - -For further information, please visit: - - * https://www.odoo.com/forum/help-1 +Now it's easier to reconcile bank transactions with PoS payments. Bug Tracker =========== Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. -If you spotted it first, help us smashing it by providing a detailed and welcomed feedback -`here `_. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. Credits ======= +Authors +~~~~~~~ + +* ACSONE SA/NV + Contributors ------------- +~~~~~~~~~~~~ * Adrien Peiffer * Meyomesse Gilles +* `Tecnativa `_ -Maintainer ----------- + * David Vidal + * Rafael Blasco + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. .. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association :target: https://odoo-community.org -This module is maintained by the OCA. +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. -OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. +This module is part of the `OCA/pos `_ project on GitHub. -To contribute to this module, please visit http://odoo-community.org. \ No newline at end of file +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/pos_payment_entries_globalization/__manifest__.py b/pos_payment_entries_globalization/__manifest__.py index 4c937a21..2152cbba 100644 --- a/pos_payment_entries_globalization/__manifest__.py +++ b/pos_payment_entries_globalization/__manifest__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2015-2017 ACSONE SA/NV () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { @@ -6,9 +5,9 @@ 'summary': """Globalize POS Payment""", 'author': 'ACSONE SA/NV,' 'Odoo Community Association (OCA)', - 'website': "http://acsone.eu", + 'website': "http://github.com/OCA/pos", 'category': 'Point Of Sale', - 'version': '10.0.1.0.0', + 'version': '11.0.1.0.0', 'license': 'AGPL-3', 'depends': [ 'point_of_sale', diff --git a/pos_payment_entries_globalization/i18n/es.po b/pos_payment_entries_globalization/i18n/es.po new file mode 100644 index 00000000..6c760b81 --- /dev/null +++ b/pos_payment_entries_globalization/i18n/es.po @@ -0,0 +1,59 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_payment_entries_globalization +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-02-21 09:03+0000\n" +"PO-Revision-Date: 2019-02-21 09:03+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: pos_payment_entries_globalization +#: model:ir.model,name:pos_payment_entries_globalization.model_account_journal +msgid "Journal" +msgstr "Diario" + +#. module: pos_payment_entries_globalization +#: model:ir.ui.view,arch_db:pos_payment_entries_globalization.view_account_journal_pos_user_form +msgid "Payment Globalization" +msgstr "Globalización de pagos" + +#. module: pos_payment_entries_globalization +#: code:addons/pos_payment_entries_globalization/models/pos_session.py:35 +#: code:addons/pos_payment_entries_globalization/models/pos_session.py:59 +#, python-format +msgid "Payment globalization" +msgstr "Globalización de pagos" + +#. module: pos_payment_entries_globalization +#: code:addons/pos_payment_entries_globalization/models/pos_session.py:44 +#, python-format +msgid "Payment globalization counterpart" +msgstr "Contrapartida de globalización de pagos" + +#. module: pos_payment_entries_globalization +#: model:ir.model.fields,field_description:pos_payment_entries_globalization.field_account_journal_pos_payment_globalization +msgid "Pos Payment Globalization" +msgstr "Globalización de pagos en Punto de Venta" + +#. module: pos_payment_entries_globalization +#: model:ir.model.fields,field_description:pos_payment_entries_globalization.field_account_journal_pos_payment_globalization_account +msgid "Pos Payment Globalization Account" +msgstr "Cuenta para globalización de pagos en Punto de Venta" + +#. module: pos_payment_entries_globalization +#: model:ir.model.fields,field_description:pos_payment_entries_globalization.field_account_journal_pos_payment_globalization_journal +msgid "Pos Payment Globalization Journal" +msgstr "Diario para globalización de pagos en Punto de Venta" + +#. module: pos_payment_entries_globalization +#: model:ir.model,name:pos_payment_entries_globalization.model_pos_session +msgid "pos.session" +msgstr "pos.session" diff --git a/pos_payment_entries_globalization/i18n/pos_payment_entries_globalization.pot b/pos_payment_entries_globalization/i18n/pos_payment_entries_globalization.pot new file mode 100644 index 00000000..86b461f8 --- /dev/null +++ b/pos_payment_entries_globalization/i18n/pos_payment_entries_globalization.pot @@ -0,0 +1,60 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_payment_entries_globalization +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-02-21 09:05+0000\n" +"PO-Revision-Date: 2019-02-21 09:05+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: pos_payment_entries_globalization +#: model:ir.model,name:pos_payment_entries_globalization.model_account_journal +msgid "Journal" +msgstr "" + +#. module: pos_payment_entries_globalization +#: model:ir.ui.view,arch_db:pos_payment_entries_globalization.view_account_journal_pos_user_form +msgid "Payment Globalization" +msgstr "" + +#. module: pos_payment_entries_globalization +#: code:addons/pos_payment_entries_globalization/models/pos_session.py:35 +#: code:addons/pos_payment_entries_globalization/models/pos_session.py:59 +#, python-format +msgid "Payment globalization" +msgstr "" + +#. module: pos_payment_entries_globalization +#: code:addons/pos_payment_entries_globalization/models/pos_session.py:44 +#, python-format +msgid "Payment globalization counterpart" +msgstr "" + +#. module: pos_payment_entries_globalization +#: model:ir.model.fields,field_description:pos_payment_entries_globalization.field_account_journal_pos_payment_globalization +msgid "Pos Payment Globalization" +msgstr "" + +#. module: pos_payment_entries_globalization +#: model:ir.model.fields,field_description:pos_payment_entries_globalization.field_account_journal_pos_payment_globalization_account +msgid "Pos Payment Globalization Account" +msgstr "" + +#. module: pos_payment_entries_globalization +#: model:ir.model.fields,field_description:pos_payment_entries_globalization.field_account_journal_pos_payment_globalization_journal +msgid "Pos Payment Globalization Journal" +msgstr "" + +#. module: pos_payment_entries_globalization +#: model:ir.model,name:pos_payment_entries_globalization.model_pos_session +msgid "pos.session" +msgstr "" + diff --git a/pos_payment_entries_globalization/models/account_journal.py b/pos_payment_entries_globalization/models/account_journal.py index 6ac06586..9acd5518 100644 --- a/pos_payment_entries_globalization/models/account_journal.py +++ b/pos_payment_entries_globalization/models/account_journal.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2015-2017 ACSONE SA/NV () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). diff --git a/pos_payment_entries_globalization/models/pos_session.py b/pos_payment_entries_globalization/models/pos_session.py index e2057252..749d9aff 100644 --- a/pos_payment_entries_globalization/models/pos_session.py +++ b/pos_payment_entries_globalization/models/pos_session.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2015-2017 ACSONE SA/NV () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). @@ -75,7 +74,7 @@ class PosSession(models.Model): self.ensure_one() grouped_move_lines = self._get_move_lines_for_globalization() to_reconcile = [] - for key, lines in grouped_move_lines.iteritems(): + for key, lines in grouped_move_lines.items(): global_account_id, global_journal_id = key move = self._prepare_globalization_move(global_journal_id) counterpart_debit = 0.0 @@ -92,12 +91,13 @@ class PosSession(models.Model): if counterpart_credit: self._prepare_globalization_counterpart_line( 0.0, counterpart_credit, global_account_id, move) + move.post() for lines in to_reconcile: lines.reconcile() @api.multi - def action_pos_session_closing_control(self): - super(PosSession, self).action_pos_session_closing_control() + def action_pos_session_close(self): + super(PosSession, self).action_pos_session_close() for record in self: # Call the method to generate globalization entries record._generate_globalization_entries() diff --git a/pos_payment_entries_globalization/readme/CONFIGURE.rst b/pos_payment_entries_globalization/readme/CONFIGURE.rst new file mode 100644 index 00000000..2d7237e2 --- /dev/null +++ b/pos_payment_entries_globalization/readme/CONFIGURE.rst @@ -0,0 +1,7 @@ +To configure this module, you need to: + + * Configure globalize account and journal on POS payment methods + (Account journal). + +A globalization entry is generated for each globalization journal and each +globalization account defined on payment methods. diff --git a/pos_payment_entries_globalization/readme/CONTRIBUTORS.rst b/pos_payment_entries_globalization/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..0f6d0c1c --- /dev/null +++ b/pos_payment_entries_globalization/readme/CONTRIBUTORS.rst @@ -0,0 +1,6 @@ +* Adrien Peiffer +* Meyomesse Gilles +* `Tecnativa `_ + + * David Vidal + * Rafael Blasco diff --git a/pos_payment_entries_globalization/readme/DESCRIPTION.rst b/pos_payment_entries_globalization/readme/DESCRIPTION.rst new file mode 100644 index 00000000..3d7442e9 --- /dev/null +++ b/pos_payment_entries_globalization/readme/DESCRIPTION.rst @@ -0,0 +1,5 @@ +This module allows to globalize payment entries created by the POS. + +In some cases, all banking transactions are received in a single bank statement +line. With this module, it's possible to reconcile this one line with the +payment globalization line. diff --git a/pos_payment_entries_globalization/readme/USAGE.rst b/pos_payment_entries_globalization/readme/USAGE.rst new file mode 100644 index 00000000..769e6255 --- /dev/null +++ b/pos_payment_entries_globalization/readme/USAGE.rst @@ -0,0 +1 @@ +Now it's easier to reconcile bank transactions with PoS payments. diff --git a/pos_payment_entries_globalization/tests/test_pos_payment_entries_globalization.py b/pos_payment_entries_globalization/tests/test_pos_payment_entries_globalization.py index 911a4878..437e455a 100644 --- a/pos_payment_entries_globalization/tests/test_pos_payment_entries_globalization.py +++ b/pos_payment_entries_globalization/tests/test_pos_payment_entries_globalization.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2015 ACSONE SA/NV () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). diff --git a/pos_payment_entries_globalization/views/account_journal_view.xml b/pos_payment_entries_globalization/views/account_journal_view.xml index 6c47f632..36e763bd 100644 --- a/pos_payment_entries_globalization/views/account_journal_view.xml +++ b/pos_payment_entries_globalization/views/account_journal_view.xml @@ -8,7 +8,7 @@ account.journal - +