diff --git a/README.md b/README.md index c33f7f2f5c8..2b612e696f7 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ addon | version | maintainers | summary [account_payment_order](account_payment_order/) | 16.0.1.12.3 | | Account Payment Order [account_payment_order_grouped_output](account_payment_order_grouped_output/) | 16.0.1.0.3 | | Account Payment Order - Generate grouped moves [account_payment_order_notification](account_payment_order_notification/) | 16.0.1.0.1 | [![victoralmau](https://github.com/victoralmau.png?size=30px)](https://github.com/victoralmau) | Account Payment Order Notification +[account_payment_order_return](account_payment_order_return/) | 16.0.1.0.1 | | Account Payment Order Return [account_payment_order_vendor_email](account_payment_order_vendor_email/) | 16.0.1.0.0 | [![ursais](https://github.com/ursais.png?size=30px)](https://github.com/ursais) | Account Payment Order Email [account_payment_partner](account_payment_partner/) | 16.0.1.2.4 | | Adds payment mode on partners and invoices [account_payment_purchase](account_payment_purchase/) | 16.0.2.0.3 | | Adds Bank Account and Payment Mode on Purchase Orders diff --git a/account_payment_order_return/README.rst b/account_payment_order_return/README.rst new file mode 100644 index 00000000000..a1beea9887a --- /dev/null +++ b/account_payment_order_return/README.rst @@ -0,0 +1,102 @@ +============================ +Account Payment Order Return +============================ + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:37cd11d39abd9d084c0bd46f8ba329b99d893c74a04374515d9aba8101cfcb91 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fbank--payment-lightgray.png?logo=github + :target: https://github.com/OCA/bank-payment/tree/16.0/account_payment_order_return + :alt: OCA/bank-payment +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/bank-payment-16-0/bank-payment-16-0-account_payment_order_return + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/bank-payment&target_branch=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module adds a check in the wizard where move lines are imported into +payment order. +This check lets include in selection lines from invoices linked to a +payment return. + +**Table of contents** + +.. contents:: + :local: + +Installation +============ + +This module is auto-installed when you install *account_payment_return* and +*account_payment_order*. + +Usage +===== + +#. Go to Invoicing > Customers > Debit Orders. +#. Create a new record. +#. Click on button "Create Payment Lines from Journal Items" to open the + wizard. +#. Click on the "Include move lines from returns" check. +#. Fill other options. +#. Click on button "Add All Move Lines". + +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 to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Tecnativa + +Contributors +~~~~~~~~~~~~ + +* Tecnativa + + * Luis M. Ontalba + * Vicent Cubells + * João Marques + +* Kitti U. + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +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/bank-payment `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_payment_order_return/__init__.py b/account_payment_order_return/__init__.py new file mode 100644 index 00000000000..211e83205b8 --- /dev/null +++ b/account_payment_order_return/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from . import wizards diff --git a/account_payment_order_return/__manifest__.py b/account_payment_order_return/__manifest__.py new file mode 100644 index 00000000000..e3166836861 --- /dev/null +++ b/account_payment_order_return/__manifest__.py @@ -0,0 +1,16 @@ +# Copyright 2017 Tecnativa - Luis M. Ontalba +# Copyright 2021 Tecnativa - João Marques +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +{ + "name": "Account Payment Order Return", + "version": "16.0.1.0.1", + "category": "Banking addons", + "author": "Tecnativa, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/bank-payment", + "depends": ["account_payment_return", "account_payment_order"], + "data": ["wizards/account_payment_line_create_view.xml"], + "license": "AGPL-3", + "installable": True, + "auto_install": True, +} diff --git a/account_payment_order_return/i18n/account_payment_order_return.pot b/account_payment_order_return/i18n/account_payment_order_return.pot new file mode 100644 index 00000000000..5b65a20a4e6 --- /dev/null +++ b/account_payment_order_return/i18n/account_payment_order_return.pot @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_payment_order_return +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \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: account_payment_order_return +#: model:ir.model.fields,field_description:account_payment_order_return.field_account_payment_line_create__include_returned +msgid "Include move lines from returns" +msgstr "" + +#. module: account_payment_order_return +#: model:ir.model,name:account_payment_order_return.model_account_payment_line_create +msgid "Wizard to create payment lines" +msgstr "" diff --git a/account_payment_order_return/i18n/ca.po b/account_payment_order_return/i18n/ca.po new file mode 100644 index 00000000000..ff91ed29c93 --- /dev/null +++ b/account_payment_order_return/i18n/ca.po @@ -0,0 +1,30 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_payment_order_return +# +# Translators: +# Marc Tormo i Bochaca , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-10-15 00:40+0000\n" +"PO-Revision-Date: 2019-10-07 09:24+0000\n" +"Last-Translator: Jaume Planas \n" +"Language-Team: Catalan (https://www.transifex.com/oca/teams/23907/ca/)\n" +"Language: ca\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 3.8\n" + +#. module: account_payment_order_return +#: model:ir.model.fields,field_description:account_payment_order_return.field_account_payment_line_create__include_returned +msgid "Include move lines from returns" +msgstr "Inclou apunts de les devolucions" + +#. module: account_payment_order_return +#: model:ir.model,name:account_payment_order_return.model_account_payment_line_create +msgid "Wizard to create payment lines" +msgstr "Assistent per crear línies de pagament" diff --git a/account_payment_order_return/i18n/ca_ES.po b/account_payment_order_return/i18n/ca_ES.po new file mode 100644 index 00000000000..57c70a47ddc --- /dev/null +++ b/account_payment_order_return/i18n/ca_ES.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_payment_order_return +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: ca_ES\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" + +#. module: account_payment_order_return +#: model:ir.model.fields,field_description:account_payment_order_return.field_account_payment_line_create__include_returned +msgid "Include move lines from returns" +msgstr "" + +#. module: account_payment_order_return +#: model:ir.model,name:account_payment_order_return.model_account_payment_line_create +msgid "Wizard to create payment lines" +msgstr "" diff --git a/account_payment_order_return/i18n/de.po b/account_payment_order_return/i18n/de.po new file mode 100644 index 00000000000..ed15bf98937 --- /dev/null +++ b/account_payment_order_return/i18n/de.po @@ -0,0 +1,29 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_payment_order_return +# +# Translators: +# Akim Juillerat , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-10-15 00:40+0000\n" +"PO-Revision-Date: 2017-10-15 00:40+0000\n" +"Last-Translator: Akim Juillerat , 2017\n" +"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: account_payment_order_return +#: model:ir.model.fields,field_description:account_payment_order_return.field_account_payment_line_create__include_returned +msgid "Include move lines from returns" +msgstr "" + +#. module: account_payment_order_return +#: model:ir.model,name:account_payment_order_return.model_account_payment_line_create +msgid "Wizard to create payment lines" +msgstr "Assistent zum Anlegen von Zahlungszeilen" diff --git a/account_payment_order_return/i18n/es.po b/account_payment_order_return/i18n/es.po new file mode 100644 index 00000000000..75c6fce945f --- /dev/null +++ b/account_payment_order_return/i18n/es.po @@ -0,0 +1,27 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_payment_order_return +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-10-13 08:31+0000\n" +"PO-Revision-Date: 2017-10-13 08:31+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_payment_order_return +#: model:ir.model.fields,field_description:account_payment_order_return.field_account_payment_line_create__include_returned +msgid "Include move lines from returns" +msgstr "Incluir efectos devueltos" + +#. module: account_payment_order_return +#: model:ir.model,name:account_payment_order_return.model_account_payment_line_create +msgid "Wizard to create payment lines" +msgstr "Asistente para crear líneas de pago" diff --git a/account_payment_order_return/i18n/es_AR.po b/account_payment_order_return/i18n/es_AR.po new file mode 100644 index 00000000000..4de65327219 --- /dev/null +++ b/account_payment_order_return/i18n/es_AR.po @@ -0,0 +1,36 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_payment_order_return +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-04-01 03:48+0000\n" +"Last-Translator: Ignacio Buioli \n" +"Language-Team: none\n" +"Language: es_AR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.3.2\n" + +#. module: account_payment_order_return +#: model:ir.model.fields,field_description:account_payment_order_return.field_account_payment_line_create__include_returned +msgid "Include move lines from returns" +msgstr "Incluir líneas de movimiento de devoluciones" + +#. module: account_payment_order_return +#: model:ir.model,name:account_payment_order_return.model_account_payment_line_create +msgid "Wizard to create payment lines" +msgstr "Asistente para crear líneas de pago" + +#~ msgid "Display Name" +#~ msgstr "Mostrar Nombre" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Última modificación en" diff --git a/account_payment_order_return/i18n/fr.po b/account_payment_order_return/i18n/fr.po new file mode 100644 index 00000000000..194674b5c7c --- /dev/null +++ b/account_payment_order_return/i18n/fr.po @@ -0,0 +1,30 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_payment_order_return +# +# Translators: +# OCA Transbot , 2017 +# Quentin THEURET , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-02 02:22+0000\n" +"PO-Revision-Date: 2017-12-02 02:22+0000\n" +"Last-Translator: Quentin THEURET , 2017\n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: account_payment_order_return +#: model:ir.model.fields,field_description:account_payment_order_return.field_account_payment_line_create__include_returned +msgid "Include move lines from returns" +msgstr "Inclure les écritures depuis les retours" + +#. module: account_payment_order_return +#: model:ir.model,name:account_payment_order_return.model_account_payment_line_create +msgid "Wizard to create payment lines" +msgstr "Assistant pour créer des lignes de paiement" diff --git a/account_payment_order_return/i18n/fr_FR.po b/account_payment_order_return/i18n/fr_FR.po new file mode 100644 index 00000000000..c0b4437b455 --- /dev/null +++ b/account_payment_order_return/i18n/fr_FR.po @@ -0,0 +1,30 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_payment_order_return +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-04-10 16:46+0000\n" +"Last-Translator: Yves Le Doeuff \n" +"Language-Team: none\n" +"Language: fr_FR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 4.3.2\n" + +#. module: account_payment_order_return +#: model:ir.model.fields,field_description:account_payment_order_return.field_account_payment_line_create__include_returned +msgid "Include move lines from returns" +msgstr "Inclure les lignes d'écritures des retours" + +#. module: account_payment_order_return +#: model:ir.model,name:account_payment_order_return.model_account_payment_line_create +msgid "Wizard to create payment lines" +msgstr "Assistant pour créer des lignes de paiement" + +#~ msgid "Last Modified on" +#~ msgstr "Dernière modification" diff --git a/account_payment_order_return/readme/CONTRIBUTORS.rst b/account_payment_order_return/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000000..0b3c25a4a7c --- /dev/null +++ b/account_payment_order_return/readme/CONTRIBUTORS.rst @@ -0,0 +1,7 @@ +* Tecnativa + + * Luis M. Ontalba + * Vicent Cubells + * João Marques + +* Kitti U. diff --git a/account_payment_order_return/readme/DESCRIPTION.rst b/account_payment_order_return/readme/DESCRIPTION.rst new file mode 100644 index 00000000000..10e16c16450 --- /dev/null +++ b/account_payment_order_return/readme/DESCRIPTION.rst @@ -0,0 +1,4 @@ +This module adds a check in the wizard where move lines are imported into +payment order. +This check lets include in selection lines from invoices linked to a +payment return. diff --git a/account_payment_order_return/readme/INSTALL.rst b/account_payment_order_return/readme/INSTALL.rst new file mode 100644 index 00000000000..b52d23104df --- /dev/null +++ b/account_payment_order_return/readme/INSTALL.rst @@ -0,0 +1,2 @@ +This module is auto-installed when you install *account_payment_return* and +*account_payment_order*. diff --git a/account_payment_order_return/readme/USAGE.rst b/account_payment_order_return/readme/USAGE.rst new file mode 100644 index 00000000000..1bff6ad9574 --- /dev/null +++ b/account_payment_order_return/readme/USAGE.rst @@ -0,0 +1,7 @@ +#. Go to Invoicing > Customers > Debit Orders. +#. Create a new record. +#. Click on button "Create Payment Lines from Journal Items" to open the + wizard. +#. Click on the "Include move lines from returns" check. +#. Fill other options. +#. Click on button "Add All Move Lines". diff --git a/account_payment_order_return/static/description/icon.png b/account_payment_order_return/static/description/icon.png new file mode 100644 index 00000000000..3a0328b516c Binary files /dev/null and b/account_payment_order_return/static/description/icon.png differ diff --git a/account_payment_order_return/static/description/index.html b/account_payment_order_return/static/description/index.html new file mode 100644 index 00000000000..281bcf07b52 --- /dev/null +++ b/account_payment_order_return/static/description/index.html @@ -0,0 +1,451 @@ + + + + + +Account Payment Order Return + + + +
+

Account Payment Order Return

+ + +

Beta License: AGPL-3 OCA/bank-payment Translate me on Weblate Try me on Runboat

+

This module adds a check in the wizard where move lines are imported into +payment order. +This check lets include in selection lines from invoices linked to a +payment return.

+

Table of contents

+ +
+

Installation

+

This module is auto-installed when you install account_payment_return and +account_payment_order.

+
+
+

Usage

+
    +
  1. Go to Invoicing > Customers > Debit Orders.
  2. +
  3. Create a new record.
  4. +
  5. Click on button “Create Payment Lines from Journal Items” to open the +wizard.
  6. +
  7. Click on the “Include move lines from returns” check.
  8. +
  9. Fill other options.
  10. +
  11. Click on button “Add All Move Lines”.
  12. +
+
+
+

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 to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Tecnativa
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

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/bank-payment project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/account_payment_order_return/tests/__init__.py b/account_payment_order_return/tests/__init__.py new file mode 100644 index 00000000000..ade564e414f --- /dev/null +++ b/account_payment_order_return/tests/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0 + +from . import test_account_payment_order_return diff --git a/account_payment_order_return/tests/test_account_payment_order_return.py b/account_payment_order_return/tests/test_account_payment_order_return.py new file mode 100644 index 00000000000..3e28df13bf2 --- /dev/null +++ b/account_payment_order_return/tests/test_account_payment_order_return.py @@ -0,0 +1,121 @@ +# Copyright 2017 Tecnativa - Luis M. Ontalba +# Copyright 2021 Tecnativa - João Marques +# Copyright 2021 Tecnativa - Víctor Martínez +# Copyright 2024 Aurestic - Almudena de La Puente +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0 + +from datetime import timedelta + +from odoo import fields +from odoo.tests.common import Form, tagged + +from odoo.addons.account.tests.common import AccountTestInvoicingCommon + + +@tagged("post_install", "-at_install") +class TestAccountPaymentOrderReturn(AccountTestInvoicingCommon): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.env = cls.env( + context=dict( + cls.env.context, + mail_create_nolog=True, + mail_create_nosubscribe=True, + mail_notrack=True, + no_reset_password=True, + tracking_disable=True, + ) + ) + cls.bank_journal = cls.env["account.journal"].create( + {"name": "Test Bank Journal", "type": "bank"} + ) + cls.invoice = cls.env["account.move"].create( + { + "move_type": "out_invoice", + "date": "2024-01-01", + "invoice_date": "2024-01-01", + "partner_id": cls.partner_a.id, + "currency_id": cls.currency_data["currency"].id, + "invoice_line_ids": [ + ( + 0, + 0, + { + "product_id": cls.product_a.id, + "price_unit": 1000.0, + "tax_ids": [], + }, + ) + ], + } + ) + cls.payment_mode = cls.env["account.payment.mode"].create( + { + "name": "Test payment mode", + "fixed_journal_id": cls.bank_journal.id, + "bank_account_link": "fixed", + "payment_method_id": cls.env.ref( + "account.account_payment_method_manual_in" + ).id, + } + ) + cls.payment_order = cls.env["account.payment.order"].create( + { + "payment_mode_id": cls.payment_mode.id, + "date_prefered": "due", + "payment_type": "inbound", + } + ) + + def test_global(self): + self.invoice.action_post() + wizard_o = self.env["account.payment.line.create"] + context = wizard_o._context.copy() + context.update( + { + "active_model": "account.payment.order", + "active_id": self.payment_order.id, + } + ) + wizard = wizard_o.with_context(**context).create( + { + "order_id": self.payment_order.id, + "journal_ids": [ + (4, self.bank_journal.id), + (4, self.invoice.journal_id.id), + ], + "partner_ids": [(4, self.partner_a.id)], + "allow_blocked": True, + "date_type": "move", + "move_date": fields.Date.today() + timedelta(days=1), + "payment_mode": "any", + "invoice": True, + "include_returned": True, + } + ) + wizard.populate() + self.assertEqual(len(wizard.move_line_ids), 1) + payment_register = Form( + self.env["account.payment.register"].with_context( + active_model="account.move", active_ids=self.invoice.ids + ) + ) + self.payment = payment_register.save()._create_payments() + if self.payment.state != "posted": + self.payment.action_post() + wizard.populate() + # Create payment return + payment_return_form = Form(self.env["payment.return"]) + payment_return_form.journal_id = self.bank_journal + with payment_return_form.line_ids.new() as line_form: + line_form.move_line_ids.add( + self.payment.move_id.line_ids.filtered( + lambda x: x.account_id.account_type == "asset_receivable" + ) + ) + self.payment_return = payment_return_form.save() + self.payment_return.action_confirm() + wizard.include_returned = False + wizard.populate() + self.assertEqual(len(wizard.move_line_ids), 0) diff --git a/account_payment_order_return/wizards/__init__.py b/account_payment_order_return/wizards/__init__.py new file mode 100644 index 00000000000..6cfe2650622 --- /dev/null +++ b/account_payment_order_return/wizards/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from . import account_payment_line_create diff --git a/account_payment_order_return/wizards/account_payment_line_create.py b/account_payment_order_return/wizards/account_payment_line_create.py new file mode 100644 index 00000000000..a70c84cac9f --- /dev/null +++ b/account_payment_order_return/wizards/account_payment_line_create.py @@ -0,0 +1,19 @@ +# Copyright 2017 Tecnativa - Luis M. Ontalba +# Copyright 2021 Tecnativa - João Marques +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from odoo import fields, models + + +class AccountPaymentLineCreate(models.TransientModel): + _inherit = "account.payment.line.create" + + include_returned = fields.Boolean(string="Include move lines from returns") + + def _prepare_move_line_domain(self): + domain = super()._prepare_move_line_domain() + if not self.include_returned: + domain += [ + ("move_id.returned_payment", "=", False), + ] + return domain diff --git a/account_payment_order_return/wizards/account_payment_line_create_view.xml b/account_payment_order_return/wizards/account_payment_line_create_view.xml new file mode 100644 index 00000000000..3b43b25c707 --- /dev/null +++ b/account_payment_order_return/wizards/account_payment_line_create_view.xml @@ -0,0 +1,15 @@ + + + + + account.payment.line.create + + + + + + + diff --git a/setup/_metapackage/VERSION.txt b/setup/_metapackage/VERSION.txt index a90a4b5afaa..a4500a240ba 100644 --- a/setup/_metapackage/VERSION.txt +++ b/setup/_metapackage/VERSION.txt @@ -1 +1 @@ -16.0.20240617.0 \ No newline at end of file +16.0.20241001.0 \ No newline at end of file diff --git a/setup/_metapackage/setup.py b/setup/_metapackage/setup.py index 478a4a05575..0448a5e0452 100644 --- a/setup/_metapackage/setup.py +++ b/setup/_metapackage/setup.py @@ -20,6 +20,7 @@ 'odoo-addon-account_payment_order>=16.0dev,<16.1dev', 'odoo-addon-account_payment_order_grouped_output>=16.0dev,<16.1dev', 'odoo-addon-account_payment_order_notification>=16.0dev,<16.1dev', + 'odoo-addon-account_payment_order_return>=16.0dev,<16.1dev', 'odoo-addon-account_payment_order_vendor_email>=16.0dev,<16.1dev', 'odoo-addon-account_payment_partner>=16.0dev,<16.1dev', 'odoo-addon-account_payment_purchase>=16.0dev,<16.1dev', diff --git a/setup/account_payment_order_return/odoo/addons/account_payment_order_return b/setup/account_payment_order_return/odoo/addons/account_payment_order_return new file mode 120000 index 00000000000..5bd13a9672f --- /dev/null +++ b/setup/account_payment_order_return/odoo/addons/account_payment_order_return @@ -0,0 +1 @@ +../../../../account_payment_order_return \ No newline at end of file diff --git a/setup/account_payment_order_return/setup.py b/setup/account_payment_order_return/setup.py new file mode 100644 index 00000000000..28c57bb6403 --- /dev/null +++ b/setup/account_payment_order_return/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)