diff --git a/account_invoice_refund_line_selection/README.rst b/account_invoice_refund_line_selection/README.rst new file mode 100644 index 00000000000..02bda85c565 --- /dev/null +++ b/account_invoice_refund_line_selection/README.rst @@ -0,0 +1,79 @@ +=========================== +Account invoice refund line +=========================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--invoicing-lightgray.png?logo=github + :target: https://github.com/OCA/account-invoicing/tree/14.0/account_invoice_refund_line_selection + :alt: OCA/account-invoicing +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/account-invoicing-14-0/account-invoicing-14-0-account_invoice_refund_line_selection + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/95/14.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows the user to refund only specific lines in invoices. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +In a open validated invoice, click on 'Add Credit Note' to open the refunding wizard. Select the +'Refund specific lines' option and select the desired invoice 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 smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Creu Blanca + +Contributors +~~~~~~~~~~~~ + +* Jaime Arroyo + +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/account-invoicing `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_invoice_refund_line_selection/__init__.py b/account_invoice_refund_line_selection/__init__.py new file mode 100644 index 00000000000..5cb1c49143f --- /dev/null +++ b/account_invoice_refund_line_selection/__init__.py @@ -0,0 +1 @@ +from . import wizards diff --git a/account_invoice_refund_line_selection/__manifest__.py b/account_invoice_refund_line_selection/__manifest__.py new file mode 100644 index 00000000000..22b79e0593d --- /dev/null +++ b/account_invoice_refund_line_selection/__manifest__.py @@ -0,0 +1,15 @@ +# Copyright 2019 Creu Blanca +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + +{ + "name": "Account invoice refund line", + "version": "16.0.1.0.0", + "category": "Accounting & Finance", + "summary": "This module allows the user to refund specific lines in a invoice", + "author": "Creu Blanca, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/account-invoicing", + "license": "LGPL-3", + "depends": ["account"], + "data": ["wizards/account_move_reversal_view.xml"], + "installable": True, +} diff --git a/account_invoice_refund_line_selection/i18n/account_invoice_refund_line_selection.pot b/account_invoice_refund_line_selection/i18n/account_invoice_refund_line_selection.pot new file mode 100644 index 00000000000..66687890533 --- /dev/null +++ b/account_invoice_refund_line_selection/i18n/account_invoice_refund_line_selection.pot @@ -0,0 +1,73 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_invoice_refund_line_selection +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.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_invoice_refund_line_selection +#: model:ir.model,name:account_invoice_refund_line_selection.model_account_move_reversal +msgid "Account Move Reversal" +msgstr "" + +#. module: account_invoice_refund_line_selection +#: model:ir.model.fields,help:account_invoice_refund_line_selection.field_account_move_reversal__refund_method +msgid "" +"Choose how you want to credit this invoice. You cannot \"modify\" nor " +"\"cancel\" if the invoice is already reconciled." +msgstr "" + +#. module: account_invoice_refund_line_selection +#: model:ir.model.fields,field_description:account_invoice_refund_line_selection.field_account_move_reversal__refund_method +msgid "Credit Method" +msgstr "" + +#. module: account_invoice_refund_line_selection +#: model:ir.model.fields,field_description:account_invoice_refund_line_selection.field_account_move_reversal__display_name +msgid "Display Name" +msgstr "" + +#. module: account_invoice_refund_line_selection +#: model:ir.model.fields,field_description:account_invoice_refund_line_selection.field_account_move_reversal__id +msgid "ID" +msgstr "" + +#. module: account_invoice_refund_line_selection +#: model_terms:ir.ui.view,arch_db:account_invoice_refund_line_selection.view_account_invoice_refund_lines +msgid "Invoice Lines" +msgstr "" + +#. module: account_invoice_refund_line_selection +#: model:ir.model.fields,field_description:account_invoice_refund_line_selection.field_account_move_reversal__line_ids +msgid "Invoice lines to refund" +msgstr "" + +#. module: account_invoice_refund_line_selection +#: model:ir.model.fields,field_description:account_invoice_refund_line_selection.field_account_move_reversal____last_update +msgid "Last Modified on" +msgstr "" + +#. module: account_invoice_refund_line_selection +#: model:ir.model.fields.selection,name:account_invoice_refund_line_selection.selection__account_move_reversal__refund_method__refund_lines +msgid "Refund specific lines" +msgstr "" + +#. module: account_invoice_refund_line_selection +#: model:ir.model.fields,field_description:account_invoice_refund_line_selection.field_account_move_reversal__selectable_invoice_lines_ids +msgid "Selectable Invoice Lines" +msgstr "" + +#. module: account_invoice_refund_line_selection +#: model_terms:ir.ui.view,arch_db:account_invoice_refund_line_selection.view_account_invoice_refund_lines +msgid "" +"Use this option if you want to refund only some specific lines in an " +"invoice." +msgstr "" diff --git a/account_invoice_refund_line_selection/i18n/ca.po b/account_invoice_refund_line_selection/i18n/ca.po new file mode 100644 index 00000000000..fa39db9f2cb --- /dev/null +++ b/account_invoice_refund_line_selection/i18n/ca.po @@ -0,0 +1,74 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_invoice_refund_line_selection +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\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" + +#. module: account_invoice_refund_line_selection +#: model:ir.model,name:account_invoice_refund_line_selection.model_account_move_reversal +msgid "Account Move Reversal" +msgstr "" + +#. module: account_invoice_refund_line_selection +#: model:ir.model.fields,help:account_invoice_refund_line_selection.field_account_move_reversal__refund_method +msgid "" +"Choose how you want to credit this invoice. You cannot \"modify\" nor " +"\"cancel\" if the invoice is already reconciled." +msgstr "" + +#. module: account_invoice_refund_line_selection +#: model:ir.model.fields,field_description:account_invoice_refund_line_selection.field_account_move_reversal__refund_method +msgid "Credit Method" +msgstr "" + +#. module: account_invoice_refund_line_selection +#: model:ir.model.fields,field_description:account_invoice_refund_line_selection.field_account_move_reversal__display_name +msgid "Display Name" +msgstr "" + +#. module: account_invoice_refund_line_selection +#: model:ir.model.fields,field_description:account_invoice_refund_line_selection.field_account_move_reversal__id +msgid "ID" +msgstr "" + +#. module: account_invoice_refund_line_selection +#: model_terms:ir.ui.view,arch_db:account_invoice_refund_line_selection.view_account_invoice_refund_lines +msgid "Invoice Lines" +msgstr "" + +#. module: account_invoice_refund_line_selection +#: model:ir.model.fields,field_description:account_invoice_refund_line_selection.field_account_move_reversal__line_ids +msgid "Invoice lines to refund" +msgstr "" + +#. module: account_invoice_refund_line_selection +#: model:ir.model.fields,field_description:account_invoice_refund_line_selection.field_account_move_reversal____last_update +msgid "Last Modified on" +msgstr "" + +#. module: account_invoice_refund_line_selection +#: model:ir.model.fields.selection,name:account_invoice_refund_line_selection.selection__account_move_reversal__refund_method__refund_lines +msgid "Refund specific lines" +msgstr "" + +#. module: account_invoice_refund_line_selection +#: model:ir.model.fields,field_description:account_invoice_refund_line_selection.field_account_move_reversal__selectable_invoice_lines_ids +msgid "Selectable Invoice Lines" +msgstr "" + +#. module: account_invoice_refund_line_selection +#: model_terms:ir.ui.view,arch_db:account_invoice_refund_line_selection.view_account_invoice_refund_lines +msgid "" +"Use this option if you want to refund only some specific lines in an " +"invoice." +msgstr "" diff --git a/account_invoice_refund_line_selection/i18n/de.po b/account_invoice_refund_line_selection/i18n/de.po new file mode 100644 index 00000000000..0efe766e59f --- /dev/null +++ b/account_invoice_refund_line_selection/i18n/de.po @@ -0,0 +1,96 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_invoice_refund_line_selection +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-07-17 12:43+0000\n" +"Last-Translator: Maria Sparenberg \n" +"Language-Team: none\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" +"X-Generator: Weblate 3.7.1\n" + +#. module: account_invoice_refund_line_selection +#: selection:account.invoice.refund,filter_refund:0 +msgid "Cancel: create credit note and reconcile" +msgstr "" + +#. module: account_invoice_refund_line_selection +#: code:addons/account_invoice_refund_line_selection/wizards/account_invoice_refund.py:48 +#, python-format +msgid "Cannot create credit note for the draft/cancelled invoice." +msgstr "" + +#. module: account_invoice_refund_line_selection +#: model:ir.model.fields,help:account_invoice_refund_line_selection.field_account_invoice_refund__filter_refund +msgid "" +"Choose how you want to credit this invoice. You cannot Modify and Cancel if " +"the invoice is already reconciled" +msgstr "" + +#. module: account_invoice_refund_line_selection +#: selection:account.invoice.refund,filter_refund:0 +msgid "Create a draft credit note" +msgstr "" + +#. module: account_invoice_refund_line_selection +#: model:ir.model.fields,field_description:account_invoice_refund_line_selection.field_account_invoice_refund__filter_refund +msgid "Credit Method" +msgstr "" + +#. module: account_invoice_refund_line_selection +#: code:addons/account_invoice_refund_line_selection/wizards/account_invoice_refund.py:63 +#: model:ir.model,name:account_invoice_refund_line_selection.model_account_invoice_refund +#, python-format +msgid "Credit Note" +msgstr "" + +#. module: account_invoice_refund_line_selection +#: model:ir.model,name:account_invoice_refund_line_selection.model_account_invoice +msgid "Invoice" +msgstr "Rechnung" + +#. module: account_invoice_refund_line_selection +#: model_terms:ir.ui.view,arch_db:account_invoice_refund_line_selection.view_account_invoice_refund_lines +msgid "Invoice Lines" +msgstr "Rechnungspositionen" + +#. module: account_invoice_refund_line_selection +#: model:ir.model.fields,field_description:account_invoice_refund_line_selection.field_account_invoice_refund__selectable_invoice_lines_ids +msgid "Invoice lines selectable" +msgstr "" + +#. module: account_invoice_refund_line_selection +#: model:ir.model.fields,field_description:account_invoice_refund_line_selection.field_account_invoice_refund__line_ids +msgid "Invoice lines to refund" +msgstr "" + +#. module: account_invoice_refund_line_selection +#: selection:account.invoice.refund,filter_refund:0 +msgid "Modify: create credit note, reconcile and create a new draft invoice" +msgstr "" + +#. module: account_invoice_refund_line_selection +#: selection:account.invoice.refund,filter_refund:0 +msgid "Refund specific lines" +msgstr "" + +#. module: account_invoice_refund_line_selection +#: code:addons/account_invoice_refund_line_selection/models/account_invoice.py:27 +#, python-format +msgid "" +"This %s has been created from: %s" +msgstr "" + +#. module: account_invoice_refund_line_selection +#: model_terms:ir.ui.view,arch_db:account_invoice_refund_line_selection.view_account_invoice_refund_lines +msgid "" +"Use this option if you want to refund only some specific lines in an invoice." +msgstr "" diff --git a/account_invoice_refund_line_selection/i18n/es.po b/account_invoice_refund_line_selection/i18n/es.po new file mode 100644 index 00000000000..d3f526e7f87 --- /dev/null +++ b/account_invoice_refund_line_selection/i18n/es.po @@ -0,0 +1,103 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_invoice_refund_line_selection +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-03-11 13:45+0000\n" +"Last-Translator: Ana Suárez \n" +"Language-Team: none\n" +"Language: 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" +"X-Generator: Weblate 4.3.2\n" + +#. module: account_invoice_refund_line_selection +#: selection:account.invoice.refund,filter_refund:0 +msgid "Cancel: create credit note and reconcile" +msgstr "Cancelar: crear una nota de crédito y conciliar" + +#. module: account_invoice_refund_line_selection +#: code:addons/account_invoice_refund_line_selection/wizards/account_invoice_refund.py:48 +#, python-format +msgid "Cannot create credit note for the draft/cancelled invoice." +msgstr "No es posible crear un abono para una factura borrador/cancelada." + +#. module: account_invoice_refund_line_selection +#: model:ir.model.fields,help:account_invoice_refund_line_selection.field_account_invoice_refund__filter_refund +msgid "" +"Choose how you want to credit this invoice. You cannot Modify and Cancel if " +"the invoice is already reconciled" +msgstr "" +"Elija cómo quiere hacer la devolución de esta factura. No puede Modificar y " +"Cancelar si la factura ya ha sido conciliada" + +#. module: account_invoice_refund_line_selection +#: selection:account.invoice.refund,filter_refund:0 +msgid "Create a draft credit note" +msgstr "Crear una nota de crédito en borrador" + +#. module: account_invoice_refund_line_selection +#: model:ir.model.fields,field_description:account_invoice_refund_line_selection.field_account_invoice_refund__filter_refund +#, fuzzy +msgid "Credit Method" +msgstr "Nota de crédito" + +#. module: account_invoice_refund_line_selection +#: code:addons/account_invoice_refund_line_selection/wizards/account_invoice_refund.py:63 +#: model:ir.model,name:account_invoice_refund_line_selection.model_account_invoice_refund +#, python-format +msgid "Credit Note" +msgstr "Nota de crédito" + +#. module: account_invoice_refund_line_selection +#: model:ir.model,name:account_invoice_refund_line_selection.model_account_invoice +msgid "Invoice" +msgstr "Factura" + +#. module: account_invoice_refund_line_selection +#: model_terms:ir.ui.view,arch_db:account_invoice_refund_line_selection.view_account_invoice_refund_lines +msgid "Invoice Lines" +msgstr "Líneas de Factura" + +#. module: account_invoice_refund_line_selection +#: model:ir.model.fields,field_description:account_invoice_refund_line_selection.field_account_invoice_refund__selectable_invoice_lines_ids +msgid "Invoice lines selectable" +msgstr "Líneas de factura elegibles" + +#. module: account_invoice_refund_line_selection +#: model:ir.model.fields,field_description:account_invoice_refund_line_selection.field_account_invoice_refund__line_ids +msgid "Invoice lines to refund" +msgstr "Líneas de factura para abonar" + +#. module: account_invoice_refund_line_selection +#: selection:account.invoice.refund,filter_refund:0 +msgid "Modify: create credit note, reconcile and create a new draft invoice" +msgstr "" +"Modificar: crear una nota de crédito, conciliar y crear una nueva factura " +"borrador" + +#. module: account_invoice_refund_line_selection +#: selection:account.invoice.refund,filter_refund:0 +msgid "Refund specific lines" +msgstr "Devolver líneas específicas" + +#. module: account_invoice_refund_line_selection +#: code:addons/account_invoice_refund_line_selection/models/account_invoice.py:27 +#, python-format +msgid "" +"This %s has been created from: %s" +msgstr "" +"Esta %s ha sido creada desde: %s" + +#. module: account_invoice_refund_line_selection +#: model_terms:ir.ui.view,arch_db:account_invoice_refund_line_selection.view_account_invoice_refund_lines +msgid "" +"Use this option if you want to refund only some specific lines in an invoice." +msgstr "Use esta opción si quiere abonar líneas específicas de una factura." diff --git a/account_invoice_refund_line_selection/i18n/nl.po b/account_invoice_refund_line_selection/i18n/nl.po new file mode 100644 index 00000000000..2d4a8fbea50 --- /dev/null +++ b/account_invoice_refund_line_selection/i18n/nl.po @@ -0,0 +1,78 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_invoice_refund_line_selection +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2022-03-26 09:17+0000\n" +"Last-Translator: Bosd \n" +"Language-Team: none\n" +"Language: nl\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_invoice_refund_line_selection +#: model:ir.model,name:account_invoice_refund_line_selection.model_account_move_reversal +msgid "Account Move Reversal" +msgstr "" + +#. module: account_invoice_refund_line_selection +#: model:ir.model.fields,help:account_invoice_refund_line_selection.field_account_move_reversal__refund_method +msgid "" +"Choose how you want to credit this invoice. You cannot \"modify\" nor " +"\"cancel\" if the invoice is already reconciled." +msgstr "" +"Kies hoe u deze factuur crediteren. Een reeds afgeletterde factuur kan niet " +"worden gewijzigd of geannuleerd." + +#. module: account_invoice_refund_line_selection +#: model:ir.model.fields,field_description:account_invoice_refund_line_selection.field_account_move_reversal__refund_method +msgid "Credit Method" +msgstr "Crediterings methode" + +#. module: account_invoice_refund_line_selection +#: model:ir.model.fields,field_description:account_invoice_refund_line_selection.field_account_move_reversal__display_name +msgid "Display Name" +msgstr "Weergavenaam" + +#. module: account_invoice_refund_line_selection +#: model:ir.model.fields,field_description:account_invoice_refund_line_selection.field_account_move_reversal__id +msgid "ID" +msgstr "ID" + +#. module: account_invoice_refund_line_selection +#: model_terms:ir.ui.view,arch_db:account_invoice_refund_line_selection.view_account_invoice_refund_lines +msgid "Invoice Lines" +msgstr "Factuur regels" + +#. module: account_invoice_refund_line_selection +#: model:ir.model.fields,field_description:account_invoice_refund_line_selection.field_account_move_reversal__line_ids +msgid "Invoice lines to refund" +msgstr "Factuur regels te crediteren" + +#. module: account_invoice_refund_line_selection +#: model:ir.model.fields,field_description:account_invoice_refund_line_selection.field_account_move_reversal____last_update +msgid "Last Modified on" +msgstr "Laatst gewijzigd op" + +#. module: account_invoice_refund_line_selection +#: model:ir.model.fields.selection,name:account_invoice_refund_line_selection.selection__account_move_reversal__refund_method__refund_lines +msgid "Refund specific lines" +msgstr "Crediteer specifieke regels" + +#. module: account_invoice_refund_line_selection +#: model:ir.model.fields,field_description:account_invoice_refund_line_selection.field_account_move_reversal__selectable_invoice_lines_ids +msgid "Selectable Invoice Lines" +msgstr "Selecteerbare factuur regels" + +#. module: account_invoice_refund_line_selection +#: model_terms:ir.ui.view,arch_db:account_invoice_refund_line_selection.view_account_invoice_refund_lines +msgid "" +"Use this option if you want to refund only some specific lines in an " +"invoice." +msgstr "Gebruik deze optie om specifieke factuur refels te crediteren." diff --git a/account_invoice_refund_line_selection/readme/CONTRIBUTORS.rst b/account_invoice_refund_line_selection/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000000..e59d51045c8 --- /dev/null +++ b/account_invoice_refund_line_selection/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Jaime Arroyo diff --git a/account_invoice_refund_line_selection/readme/DESCRIPTION.rst b/account_invoice_refund_line_selection/readme/DESCRIPTION.rst new file mode 100644 index 00000000000..4f73dfdf395 --- /dev/null +++ b/account_invoice_refund_line_selection/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module allows the user to refund only specific lines in invoices. diff --git a/account_invoice_refund_line_selection/readme/USAGE.rst b/account_invoice_refund_line_selection/readme/USAGE.rst new file mode 100644 index 00000000000..125e254ecdd --- /dev/null +++ b/account_invoice_refund_line_selection/readme/USAGE.rst @@ -0,0 +1,2 @@ +In a open validated invoice, click on 'Add Credit Note' to open the refunding wizard. Select the +'Refund specific lines' option and select the desired invoice lines. diff --git a/account_invoice_refund_line_selection/static/description/icon.png b/account_invoice_refund_line_selection/static/description/icon.png new file mode 100644 index 00000000000..3a0328b516c Binary files /dev/null and b/account_invoice_refund_line_selection/static/description/icon.png differ diff --git a/account_invoice_refund_line_selection/static/description/index.html b/account_invoice_refund_line_selection/static/description/index.html new file mode 100644 index 00000000000..39f72da2fb7 --- /dev/null +++ b/account_invoice_refund_line_selection/static/description/index.html @@ -0,0 +1,425 @@ + + + + + + +Account invoice refund line + + + +
+

Account invoice refund line

+ + +

Beta License: LGPL-3 OCA/account-invoicing Translate me on Weblate Try me on Runbot

+

This module allows the user to refund only specific lines in invoices.

+

Table of contents

+ +
+

Usage

+

In a open validated invoice, click on ‘Add Credit Note’ to open the refunding wizard. Select the +‘Refund specific lines’ option and select the desired invoice 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 smashing it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Creu Blanca
  • +
+
+ +
+

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/account-invoicing project on GitHub.

+

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

+
+
+
+ + diff --git a/account_invoice_refund_line_selection/tests/__init__.py b/account_invoice_refund_line_selection/tests/__init__.py new file mode 100644 index 00000000000..10415fb43a7 --- /dev/null +++ b/account_invoice_refund_line_selection/tests/__init__.py @@ -0,0 +1 @@ +from . import test_refund_line diff --git a/account_invoice_refund_line_selection/tests/test_refund_line.py b/account_invoice_refund_line_selection/tests/test_refund_line.py new file mode 100644 index 00000000000..9ee565d15cf --- /dev/null +++ b/account_invoice_refund_line_selection/tests/test_refund_line.py @@ -0,0 +1,138 @@ +# Copyright 2019 Creu Blanca +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). +from odoo.tests import tagged + +from odoo.addons.account.tests.common import AccountTestInvoicingCommon + + +@tagged("post_install", "-at_install") +class TestInvoiceRefundLine(AccountTestInvoicingCommon): + @classmethod + def setUpClass(cls, chart_template_ref=None): + super().setUpClass(chart_template_ref=chart_template_ref) + 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.in_invoice = cls.init_invoice( + "in_invoice", products=cls.product_a + cls.product_b + ) + cls.in_invoice._post() + cls.out_invoice = cls.init_invoice( + "out_invoice", products=cls.product_a + cls.product_b + ) + cls.out_invoice._post() + + def test_partial_refund_in_invoice(self): + reversal = ( + self.env["account.move.reversal"] + .with_context( + active_id=self.in_invoice.id, + active_model=self.in_invoice._name, + active_ids=self.in_invoice.ids, + ) + .create( + { + "journal_id": self.in_invoice.journal_id.id, + } + ) + ) + self.assertEqual( + reversal.selectable_invoice_lines_ids, + self.in_invoice.invoice_line_ids, + ) + line = self.in_invoice.invoice_line_ids[0] + reversal.write({"refund_method": "refund_lines", "line_ids": [(4, line.id)]}) + action = reversal.reverse_moves() + refund = self.env[action["res_model"]].browse(action["res_id"]) + self.assertTrue(refund) + self.assertEqual(refund._name, "account.move") + self.assertEqual(1, len(refund.invoice_line_ids)) + self.assertEqual(line.product_id, refund.invoice_line_ids.product_id) + self.assertNotEqual( + (self.in_invoice.invoice_line_ids - line).product_id, + refund.invoice_line_ids.product_id, + ) + self.assertNotEqual(refund.amount_total, self.out_invoice.amount_total) + + def test_total_refund_in_invoice(self): + """Checking the old functionality""" + reversal = ( + self.env["account.move.reversal"] + .with_context( + active_id=self.in_invoice.id, + active_model=self.in_invoice._name, + active_ids=self.in_invoice.ids, + ) + .create( + { + "journal_id": self.in_invoice.journal_id.id, + } + ) + ) + action = reversal.reverse_moves() + refund = self.env[action["res_model"]].browse(action["res_id"]) + self.assertTrue(refund) + self.assertEqual(refund._name, "account.move") + self.assertEqual(2, len(refund.invoice_line_ids)) + self.assertEqual(refund.amount_total, self.in_invoice.amount_total) + + def test_partial_refund_out_invoice(self): + reversal = ( + self.env["account.move.reversal"] + .with_context( + active_id=self.out_invoice.id, + active_model=self.out_invoice._name, + active_ids=self.out_invoice.ids, + ) + .create( + { + "journal_id": self.out_invoice.journal_id.id, + } + ) + ) + self.assertEqual( + reversal.selectable_invoice_lines_ids, + self.out_invoice.invoice_line_ids, + ) + line = self.out_invoice.invoice_line_ids[0] + reversal.write({"refund_method": "refund_lines", "line_ids": [(4, line.id)]}) + action = reversal.reverse_moves() + refund = self.env[action["res_model"]].browse(action["res_id"]) + self.assertTrue(refund) + self.assertEqual(refund._name, "account.move") + self.assertEqual(1, len(refund.invoice_line_ids)) + self.assertEqual(line.product_id, refund.invoice_line_ids.product_id) + self.assertNotEqual( + (self.out_invoice.invoice_line_ids - line).product_id, + refund.invoice_line_ids.product_id, + ) + self.assertNotEqual(refund.amount_total, self.out_invoice.amount_total) + + def test_total_refund_out_invoice(self): + """Checking the old functionality""" + reversal = ( + self.env["account.move.reversal"] + .with_context( + active_id=self.out_invoice.id, + active_model=self.out_invoice._name, + active_ids=self.out_invoice.ids, + ) + .create( + { + "journal_id": self.out_invoice.journal_id.id, + } + ) + ) + action = reversal.reverse_moves() + refund = self.env[action["res_model"]].browse(action["res_id"]) + self.assertTrue(refund) + self.assertEqual(refund._name, "account.move") + self.assertEqual(2, len(refund.invoice_line_ids)) + self.assertEqual(refund.amount_total, self.out_invoice.amount_total) diff --git a/account_invoice_refund_line_selection/wizards/__init__.py b/account_invoice_refund_line_selection/wizards/__init__.py new file mode 100644 index 00000000000..715d1bd6df0 --- /dev/null +++ b/account_invoice_refund_line_selection/wizards/__init__.py @@ -0,0 +1 @@ +from . import account_move_reversal diff --git a/account_invoice_refund_line_selection/wizards/account_move_reversal.py b/account_invoice_refund_line_selection/wizards/account_move_reversal.py new file mode 100644 index 00000000000..57059155392 --- /dev/null +++ b/account_invoice_refund_line_selection/wizards/account_move_reversal.py @@ -0,0 +1,58 @@ +# Copyright 2019 Creu Blanca +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + +from odoo import api, fields, models + + +class AccountInvoiceRefund(models.TransientModel): + _inherit = "account.move.reversal" + + refund_method = fields.Selection( + selection_add=[("refund_lines", "Refund specific lines")], + ondelete={"refund_lines": "cascade"}, + ) + line_ids = fields.Many2many( + string="Invoice lines to refund", + comodel_name="account.move.line", + column1="wiz_id", + column2="line_id", + relation="account_invoice_line_refund_rel", + domain="[('id', 'in', selectable_invoice_lines_ids)]", + ) + selectable_invoice_lines_ids = fields.Many2many( + "account.move.line", + ) + + @api.model + def default_get(self, fields): + rec = super().default_get(fields) + context = dict(self._context or {}) + active_id = context.get("active_id", False) + if active_id: + inv = self.env["account.move"].browse(active_id) + rec.update( + {"selectable_invoice_lines_ids": [(6, 0, inv.invoice_line_ids.ids)]} + ) + return rec + + def _prepare_default_reversal(self, move): + res = super()._prepare_default_reversal(move) + if self.refund_method == "refund_lines": + vals = res.copy() + vals["line_ids"] = [ + ( + 0, + 0, + li.with_context(include_business_fields=True).copy_data( + {"move_id": False} + )[0], + ) + for li in self.line_ids + ] + reversal_inv = self.env["account.move"].new(vals) + lines = [] + for line in reversal_inv.line_ids: + dict_line = line._convert_to_write(line._cache) + lines.append((0, 0, dict_line)) + res["line_ids"] = lines + return res diff --git a/account_invoice_refund_line_selection/wizards/account_move_reversal_view.xml b/account_invoice_refund_line_selection/wizards/account_move_reversal_view.xml new file mode 100644 index 00000000000..79b50932244 --- /dev/null +++ b/account_invoice_refund_line_selection/wizards/account_move_reversal_view.xml @@ -0,0 +1,47 @@ + + + + account.move.reversal.lines.form + account.move.reversal + + + + + + + + + + + + + + + + + + + + + + +
+ Use this option if you want to refund only some specific lines in an invoice. +
+
+
+
+
diff --git a/setup/account_invoice_refund_line_selection/odoo/addons/account_invoice_refund_line_selection b/setup/account_invoice_refund_line_selection/odoo/addons/account_invoice_refund_line_selection new file mode 120000 index 00000000000..d23fd399f62 --- /dev/null +++ b/setup/account_invoice_refund_line_selection/odoo/addons/account_invoice_refund_line_selection @@ -0,0 +1 @@ +../../../../account_invoice_refund_line_selection \ No newline at end of file diff --git a/setup/account_invoice_refund_line_selection/setup.py b/setup/account_invoice_refund_line_selection/setup.py new file mode 100644 index 00000000000..28c57bb6403 --- /dev/null +++ b/setup/account_invoice_refund_line_selection/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)