diff --git a/pos_payment_change/README.rst b/pos_payment_change/README.rst new file mode 100644 index 0000000000..81e490306c --- /dev/null +++ b/pos_payment_change/README.rst @@ -0,0 +1,148 @@ +=============================== +Point Of Sale - Change Payments +=============================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:529101d8836d4b63bf8f6d96f317785239c738c7a2458951dd0a92935856156a + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/12.0/pos_payment_change + :alt: OCA/pos +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/pos-12-0/pos-12-0-pos_payment_change + :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/pos&target_branch=12.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module extends the functionnality of the Odoo Point of Sale to +allow the cashier to change the payments of a PoS order. + +This feature is usefull when the user realized that he did a mistake, +just after he marked the order as paid, or during the close of the session, +Only if entries has not been generated. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +* Go to Point of Sale > Configuration > Point of Sale +* Edit your point of sale, and select a value for the field + 'Payment Change Policy'. + +Two options are available: + +* 'Refund and Resale': Odoo will refund the current + Pos Order to cancel it, and create a new PoS Order + with the correct payment lines + +* 'Update Payments': Odoo will change payment lines. + +.. figure:: https://raw.githubusercontent.com/OCA/pos/12.0/pos_payment_change/static/description/pos_config_form.png + + +**Note** +In some countries the 'Update Payments' Option +is not allowed by law, because orders history shouldn't not be altered. + +For that purpose, a constrains is present to check the value of this +field. If the module ``l10n_fr_certification`` is installed and if the +current company has an inalterable accounting, it will not be possible +to select the value 'Update Payments'. + +Usage +===== + +* Go to a PoS Order + +* Click on the button 'Change Payments' + +.. figure:: https://raw.githubusercontent.com/OCA/pos/12.0/pos_payment_change/static/description/pos_order_form.png + +* In the pop up wizard, select the real payment(s) that have been + used to pay the order + +.. figure:: https://raw.githubusercontent.com/OCA/pos/12.0/pos_payment_change/static/description/pos_payment_change_wizard_form.png + +* Then click on the button 'Change Payments' + +**Note** + +If the option 'Refund and Resale' is selected, changing the payments will +display the three PoS orders. the oringal one, the refund one, and the new one. + +.. figure:: https://raw.githubusercontent.com/OCA/pos/12.0/pos_payment_change/static/description/pos_order_tree.png + +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 +~~~~~~~ + +* GRAP + +Contributors +~~~~~~~~~~~~ + +* Sylvain LE GAL +* Julien WESTE + +Other credits +~~~~~~~~~~~~~ + +The development of this module has been financially supported by: + +* GRAP, Groupement Régional Alimentaire de proximité (www.grap.coop) +* Vracoop (www.vracoop.fr) + +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. + +.. |maintainer-legalsylvain| image:: https://github.com/legalsylvain.png?size=40px + :target: https://github.com/legalsylvain + :alt: legalsylvain + +Current `maintainer `__: + +|maintainer-legalsylvain| + +This module is part of the `OCA/pos `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/pos_payment_change/__init__.py b/pos_payment_change/__init__.py new file mode 100644 index 0000000000..aee8895e7a --- /dev/null +++ b/pos_payment_change/__init__.py @@ -0,0 +1,2 @@ +from . import models +from . import wizards diff --git a/pos_payment_change/__manifest__.py b/pos_payment_change/__manifest__.py new file mode 100644 index 0000000000..6f32968b9e --- /dev/null +++ b/pos_payment_change/__manifest__.py @@ -0,0 +1,22 @@ +# Copyright (C) 2013 - Today: GRAP (http://www.grap.coop) +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +{ + "name": "Point Of Sale - Change Payments", + "version": "11.0.1.0.0", + "summary": "Allow cashier to change order payments, as long as" + " the session is not closed.", + "category": "Point Of Sale", + "author": "GRAP, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/pos", + "license": "AGPL-3", + "depends": ["point_of_sale"], + "maintainers": ["legalsylvain"], + "development_status": "Beta", + "data": [ + "wizards/view_pos_payment_change_wizard.xml", + "views/view_pos_config.xml", + "views/view_pos_order.xml", + ], + "installable": True, +} diff --git a/pos_payment_change/i18n/de.po b/pos_payment_change/i18n/de.po new file mode 100644 index 0000000000..2a7d1e8020 --- /dev/null +++ b/pos_payment_change/i18n/de.po @@ -0,0 +1,246 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_payment_change +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-04-08 07:52+0000\n" +"Last-Translator: André Volksdorf \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 4.3.2\n" + +#. module: pos_payment_change +#: code:addons/pos_payment_change/models/pos_order.py:84 +#, python-format +msgid " (Refund Order: %s ; Resale Order: %s)" +msgstr " (Rückerstattungsauftrag: %s ; Wiederverkaufsauftrag: %s)" + +#. module: pos_payment_change +#: model_terms:ir.ui.view,arch_db:pos_payment_change.view_pos_config_form +msgid "Payment Change Policy" +msgstr "Richtlinie für Zahlungsänderungen" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line__amount +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line__amount +msgid "Amount" +msgstr "Betrag" + +#. module: pos_payment_change +#: model_terms:ir.ui.view,arch_db:pos_payment_change.view_pos_payment_change_wizard_form +msgid "Cancel" +msgstr "Abbrechen" + +#. module: pos_payment_change +#: model:ir.actions.act_window,name:pos_payment_change.action_pos_payment_change_wizard +#: model_terms:ir.ui.view,arch_db:pos_payment_change.view_pos_order_form +#: model_terms:ir.ui.view,arch_db:pos_payment_change.view_pos_payment_change_wizard_form +msgid "Change Payments" +msgstr "Zahlung ändern" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line__company_currency_id +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line__company_currency_id +msgid "Company Currency" +msgstr "Währung" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard__create_uid +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line__create_uid +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line__create_uid +msgid "Created by" +msgstr "Erstellt von" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard__create_date +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line__create_date +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line__create_date +msgid "Created on" +msgstr "Erstellt am" + +#. module: pos_payment_change +#: code:addons/pos_payment_change/wizards/pos_payment_change_wizard.py:72 +#, python-format +msgid "" +"Differences between the two values for the POS Order '%s':\n" +"\n" +" * Total of all the new payments %s;\n" +" * Total of the POS Order %s;\n" +"\n" +"Please change the payments." +msgstr "" +"Differenzen zwischen den beiden Werten für den POS-Auftrag '%s':\n" +"\n" +" * Summe aller neuen Zahlungen %s;\n" +" * Summe des POS-Auftrags %s;\n" +"\n" +"Bitte ändern Sie die Zahlungen." + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard__display_name +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line__display_name +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line__display_name +msgid "Display Name" +msgstr "Anzeigename" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard__id +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line__id +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line__id +msgid "ID" +msgstr "ID" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line__new_journal_id +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line__old_journal_id +msgid "Journal" +msgstr "Journal" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard____last_update +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line____last_update +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line____last_update +msgid "Last Modified on" +msgstr "Zuletzt geändert am" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard__write_uid +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line__write_uid +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line__write_uid +msgid "Last Updated by" +msgstr "Zuletzt aktualisiert von" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard__write_date +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line__write_date +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line__write_date +msgid "Last Updated on" +msgstr "Zuletzt aktualisiert am" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard__new_line_ids +msgid "New Payment Lines" +msgstr "Neue Zahlungslinien" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard__old_line_ids +msgid "Old Payment Lines" +msgstr "Alte Zahlungslinien" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard__order_id +msgid "Order" +msgstr "Auftrag" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_config__payment_change_policy +msgid "Payment Change Policy" +msgstr "Richtlinie für Zahlungsänderungen" + +#. module: pos_payment_change +#: model:ir.model.fields,help:pos_payment_change.field_pos_config__payment_change_policy +msgid "" +"Payment Change Policy when users want to change the payment lines of a given " +"PoS Order.\n" +"* 'Refund and Resale': Odoo will refund the current Pos Order to cancel it, " +"and create a new PoS Order with the correct payment lines.\n" +"* 'Update Payments': Odoo will change payment lines.\n" +"\n" +"Note : In some countries the 'Update Payments' Option is not allowed by law, " +"because orders history shouldn't not be altered." +msgstr "" +"Richtlinie für Zahlungsänderungen, wenn Benutzer die Zahlungszeilen eines " +"bestimmten PoS-Auftrags ändern möchten.\n" +"* 'Rückerstattung und Wiederverkauf': Odoo erstattet den aktuellen PoS-" +"Auftrag zurück, um ihn zu stornieren, und erstellt einen neuen PoS-Auftrag " +"mit den korrekten Zahlungszeilen.\n" +"* 'Zahlungen aktualisieren': Odoo wird die Zahlungszeilen ändern.\n" +"\n" +"Hinweis: In einigen Ländern ist die Option 'Zahlungen aktualisieren' " +"gesetzlich nicht erlaubt, da die Bestellhistorie nicht verändert werden darf." + +#. module: pos_payment_change +#: model:ir.model,name:pos_payment_change.model_pos_payment_change_wizard +msgid "PoS Payment Change Wizard" +msgstr "PoS-Zahlungsänderungs-Assistent" + +#. module: pos_payment_change +#: model:ir.model,name:pos_payment_change.model_pos_payment_change_wizard_new_line +msgid "PoS Payment Change Wizard New Line" +msgstr "PoS-Zahlungsänderungsassistent Neue Zeile" + +#. module: pos_payment_change +#: model:ir.model,name:pos_payment_change.model_pos_payment_change_wizard_old_line +msgid "PoS Payment Change Wizard Old Line" +msgstr "PoS-Zahlungsänderungsassistent Alte Zeile" + +#. module: pos_payment_change +#: model:ir.model,name:pos_payment_change.model_pos_config +msgid "Point of Sale Configuration" +msgstr "Konfiguration der Verkaufsstelle" + +#. module: pos_payment_change +#: model:ir.model,name:pos_payment_change.model_pos_order +msgid "Point of Sale Orders" +msgstr "Bestellungen am Point of Sale" + +#. module: pos_payment_change +#: selection:pos.config,payment_change_policy:0 +msgid "Refund and Resale" +msgstr "Rückerstattung und Wiederverkauf" + +#. module: pos_payment_change +#: code:addons/pos_payment_change/models/pos_order.py:43 +#, python-format +msgid "The payments of the Order %s (Ref: %s) has been changed by %s at %s." +msgstr "Die Zahlungen des Auftrags %s (Ref: %s) wurden von %s bei %s geändert." + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard__amount_total +#: model_terms:ir.ui.view,arch_db:pos_payment_change.view_pos_payment_change_wizard_form +msgid "Total" +msgstr "Gesamt" + +#. module: pos_payment_change +#: code:addons/pos_payment_change/models/pos_config.py:43 +#, python-format +msgid "" +"Unable to use the 'Update Payments' options for companies that have " +"unalterable accounting." +msgstr "" +"Die Optionen 'Zahlungen aktualisieren' können nicht für Firmen mit " +"unveränderlicher Buchhaltung verwendet werden." + +#. module: pos_payment_change +#: selection:pos.config,payment_change_policy:0 +msgid "Update Payments" +msgstr "Zahlungen aktualisieren" + +#. module: pos_payment_change +#: model:ir.model.fields,help:pos_payment_change.field_pos_payment_change_wizard_new_line__company_currency_id +#: model:ir.model.fields,help:pos_payment_change.field_pos_payment_change_wizard_old_line__company_currency_id +msgid "Utility field to express amount currency" +msgstr "Utility-Feld zur Angabe der Betragswährung" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line__wizard_id +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line__wizard_id +msgid "Wizard" +msgstr "Assistent" + +#. module: pos_payment_change +#: code:addons/pos_payment_change/models/pos_order.py:102 +#, python-format +msgid "" +"You can not change payments of the POS '%s' because the associated session " +"'%s' has been closed!" +msgstr "" +"Sie können Zahlungen der Kasse '%s' nicht ändern, da die zugehörige Sitzung " +"'%s' geschlossen wurde!" diff --git a/pos_payment_change/i18n/es.po b/pos_payment_change/i18n/es.po new file mode 100644 index 0000000000..f0eec9de3f --- /dev/null +++ b/pos_payment_change/i18n/es.po @@ -0,0 +1,228 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_payment_change +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-11-06 08:44+0000\n" +"PO-Revision-Date: 2023-11-06 08:44+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_change +#: code:addons/pos_payment_change/models/pos_order.py:84 +#, python-format +msgid " (Refund Order: %s ; Resale Order: %s)" +msgstr " (Orden de reembolso: %s ; Orden de reventa: %s)" + +#. module: pos_payment_change +#: model:ir.ui.view,arch_db:pos_payment_change.view_pos_config_form +msgid "Payment Change Policy" +msgstr "Política de cambio de pago" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line_amount +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line_amount +msgid "Amount" +msgstr "Importe" + +#. module: pos_payment_change +#: model:ir.ui.view,arch_db:pos_payment_change.view_pos_payment_change_wizard_form +msgid "Cancel" +msgstr "Cancelar" + +#. module: pos_payment_change +#: model:ir.actions.act_window,name:pos_payment_change.action_pos_payment_change_wizard +#: model:ir.ui.view,arch_db:pos_payment_change.view_pos_order_form +#: model:ir.ui.view,arch_db:pos_payment_change.view_pos_payment_change_wizard_form +msgid "Change Payments" +msgstr "Cambiar pagos" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line_company_currency_id +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line_company_currency_id +msgid "Company Currency" +msgstr "Moneda de la Compañía" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_create_uid +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line_create_uid +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line_create_uid +msgid "Created by" +msgstr "Creado por" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_create_date +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line_create_date +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line_create_date +msgid "Created on" +msgstr "Creado el" + +#. module: pos_payment_change +#: code:addons/pos_payment_change/wizards/pos_payment_change_wizard.py:72 +#, python-format +msgid "Differences between the two values for the POS Order '%s':\n" +"\n" +" * Total of all the new payments %s;\n" +" * Total of the POS Order %s;\n" +"\n" +"Please change the payments." +msgstr "Diferencias entre los dos valores para la orden PdV '%s':\n" +"\n" +" * Total de todos los nuevos pagos %s;\n" +" * Total del pedido del punto de venta %s;\n" +"\n" +"Por favor cambie los pagos." + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_display_name +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line_display_name +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line_display_name +msgid "Display Name" +msgstr "Nombre a Mostrar" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_id +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line_id +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line_id +msgid "ID" +msgstr "ID" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line_new_journal_id +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line_old_journal_id +msgid "Journal" +msgstr "Diario" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard___last_update +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line___last_update +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line___last_update +msgid "Last Modified on" +msgstr "Última Modificación en" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line_write_uid +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line_write_uid +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_write_uid +msgid "Last Updated by" +msgstr "Última actualización por" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line_write_date +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line_write_date +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_write_date +msgid "Last Updated on" +msgstr "Última actualización el" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line_ids +msgid "New Payment Lines" +msgstr "Nuevas líneas de pago" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line_ids +msgid "Old Payment Lines" +msgstr "Viejas líneas de pago" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_order_id +msgid "Order" +msgstr "Pedido" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_config_payment_change_policy +msgid "Payment Change Policy" +msgstr "Política de cambio de pago" + +#. module: pos_payment_change +#: model:ir.model.fields,help:pos_payment_change.field_pos_config_payment_change_policy +msgid "Payment Change Policy when users want to change the payment lines of a given PoS Order.\n" +"* 'Refund and Resale': Odoo will refund the current Pos Order to cancel it, and create a new PoS Order with the correct payment lines.\n" +"* 'Update Payments': Odoo will change payment lines.\n" +"\n" +"Note : In some countries the 'Update Payments' Option is not allowed by law, because orders history shouldn't not be altered." +msgstr "Política de cambio de pago cuando los usuarios desean cambiar las líneas de pago de un pedido PdV determinado.\n" +"* 'Reembolso y reventa': Odoo reembolsará el pedido de posición actual para cancelarlo y creará un nuevo pedido de PoS con las líneas de pago correctas.\n" +"* 'Actualizar pagos': Odoo cambiará las líneas de pago.\n" +"\n" +"Nota: En algunos países, la opción 'Actualizar pagos' no está permitida por " +"ley, ya que el historial de pedidos no debe modificarse." + +#. module: pos_payment_change +#: model:ir.model,name:pos_payment_change.model_pos_payment_change_wizard +msgid "PoS Payment Change Wizard" +msgstr "Asistente de cambio de pago del PdV" + +#. module: pos_payment_change +#: model:ir.model,name:pos_payment_change.model_pos_payment_change_wizard_new_line +msgid "PoS Payment Change Wizard New Line" +msgstr "Asistente de cambio de pago de una nueva línea del PdV" + +#. module: pos_payment_change +#: model:ir.model,name:pos_payment_change.model_pos_payment_change_wizard_old_line +msgid "PoS Payment Change Wizard Old Line" +msgstr "Asistente de cambio de pago de una línea antigua del PdV" + +#. module: pos_payment_change +#: model:ir.model,name:pos_payment_change.model_pos_order +msgid "Point of Sale Orders" +msgstr "Pedidos del Punto de Venta" + +#. module: pos_payment_change +#: selection:pos.config,payment_change_policy:0 +msgid "Refund and Resale" +msgstr "Reembolso y reventa" + +#. module: pos_payment_change +#: code:addons/pos_payment_change/models/pos_order.py:43 +#, python-format +msgid "The payments of the Order %s (Ref: %s) has been changed by %s at %s." +msgstr "Los pagos de la orden %s (Ref: %s) han sido modificados por %s en %s." + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_amount_total +#: model:ir.ui.view,arch_db:pos_payment_change.view_pos_payment_change_wizard_form +msgid "Total" +msgstr "Total" + +#. module: pos_payment_change +#: code:addons/pos_payment_change/models/pos_config.py:43 +#, python-format +msgid "Unable to use the 'Update Payments' options for companies that have unalterable accounting." +msgstr "No se pueden usar las opciones de 'Actualizar pagos' para empresas que tienen contabilidad inalterable." + +#. module: pos_payment_change +#: selection:pos.config,payment_change_policy:0 +msgid "Update Payments" +msgstr "Actualizar pagos" + +#. module: pos_payment_change +#: model:ir.model.fields,help:pos_payment_change.field_pos_payment_change_wizard_new_line_company_currency_id +#: model:ir.model.fields,help:pos_payment_change.field_pos_payment_change_wizard_old_line_company_currency_id +msgid "Utility field to express amount currency" +msgstr "Campo útil para expresar importe en moneda." + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line_wizard_id +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line_wizard_id +msgid "Wizard" +msgstr "Asistente" + +#. module: pos_payment_change +#: code:addons/pos_payment_change/models/pos_order.py:102 +#, python-format +msgid "You can not change payments of the POS '%s' because the associated session '%s' has been closed!" +msgstr "¡No puede cambiar los pagos del PdV '%s' porque la sesión asociada '%s' se ha cerrado!" + +#. module: pos_payment_change +#: model:ir.model,name:pos_payment_change.model_pos_config +msgid "pos.config" +msgstr "pos.config" + diff --git a/pos_payment_change/i18n/fr.po b/pos_payment_change/i18n/fr.po new file mode 100644 index 0000000000..663e3d9727 --- /dev/null +++ b/pos_payment_change/i18n/fr.po @@ -0,0 +1,248 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_payment_change +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-05-18 17:33+0000\n" +"PO-Revision-Date: 2020-05-18 17:33+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: pos_payment_change +#: code:addons/pos_payment_change/models/pos_order.py:84 +#, python-format +msgid " (Refund Order: %s ; Resale Order: %s)" +msgstr " (Remboursement: %s ; Revente : %s)" + +#. module: pos_payment_change +#: model_terms:ir.ui.view,arch_db:pos_payment_change.view_pos_config_form +msgid "Payment Change Policy" +msgstr "Méthode de changement de paiement" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line__amount +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line__amount +msgid "Amount" +msgstr "Montant" + +#. module: pos_payment_change +#: model_terms:ir.ui.view,arch_db:pos_payment_change.view_pos_payment_change_wizard_form +msgid "Cancel" +msgstr "Annuler" + +#. module: pos_payment_change +#: model:ir.actions.act_window,name:pos_payment_change.action_pos_payment_change_wizard +#: model_terms:ir.ui.view,arch_db:pos_payment_change.view_pos_order_form +#: model_terms:ir.ui.view,arch_db:pos_payment_change.view_pos_payment_change_wizard_form +msgid "Change Payments" +msgstr "Changer les paiements" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line__company_currency_id +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line__company_currency_id +msgid "Company Currency" +msgstr "" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard__create_uid +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line__create_uid +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line__create_uid +msgid "Created by" +msgstr "Créé par" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard__create_date +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line__create_date +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line__create_date +msgid "Created on" +msgstr "Créé le" + +#. module: pos_payment_change +#: code:addons/pos_payment_change/wizards/pos_payment_change_wizard.py:72 +#, python-format +msgid "" +"Differences between the two values for the POS Order '%s':\n" +"\n" +" * Total of all the new payments %s;\n" +" * Total of the POS Order %s;\n" +"\n" +"Please change the payments." +msgstr "" +"Différences entre les deux valeurs pour la vente '%s':\n" +"\n" +" * Total des nouveaux paiements %s;\n" +" * Total de la vente %s;\n" +"\n" +"Veuillez changer les paiements." + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard__display_name +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line__display_name +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line__display_name +msgid "Display Name" +msgstr "Nom affiché" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard__id +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line__id +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line__id +msgid "ID" +msgstr "ID" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line__new_journal_id +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line__old_journal_id +msgid "Journal" +msgstr "Journal" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard____last_update +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line____last_update +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line____last_update +msgid "Last Modified on" +msgstr "Dernière modification le" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard__write_uid +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line__write_uid +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line__write_uid +msgid "Last Updated by" +msgstr "Dernière mise à jour par" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard__write_date +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line__write_date +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line__write_date +msgid "Last Updated on" +msgstr "Dernière mise à jour le" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard__new_line_ids +msgid "New Payment Lines" +msgstr "Nouveaux paiements" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard__old_line_ids +msgid "Old Payment Lines" +msgstr "Anciens paiements" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard__order_id +msgid "Order" +msgstr "Commande" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_config__payment_change_policy +msgid "Payment Change Policy" +msgstr "Méthode de changement de paiement" + +#. module: pos_payment_change +#: model:ir.model.fields,help:pos_payment_change.field_pos_config__payment_change_policy +msgid "" +"Payment Change Policy when users want to change the payment lines of a given " +"PoS Order.\n" +"* 'Refund and Resale': Odoo will refund the current Pos Order to cancel it, " +"and create a new PoS Order with the correct payment lines.\n" +"* 'Update Payments': Odoo will change payment lines.\n" +"\n" +"Note : In some countries the 'Update Payments' Option is not allowed by law, " +"because orders history shouldn't not be altered." +msgstr "" +"Méthode de changement de paiement quand les utilisateurs veulent changer des " +"lignes de paiement d'une vente en caisse.\n" +"* 'Retourner et revendre': Odoo va réaliser un retour du la vente pour " +"l'annuler, puis recréera une nouvelle vente, avec les paiements corrects.\n" +"* 'Modifier les paiements': Odoo va changer les lignes de paiements.\n" +"\n" +"Note : dans certains pays, l'option 'Modifier les paiements' n'est pas " +"autorisé par la loi, parce que l'historique des ventes ne doit pas être " +"altéré." + +#. module: pos_payment_change +#: model:ir.model,name:pos_payment_change.model_pos_payment_change_wizard +msgid "PoS Payment Change Wizard" +msgstr "Assistant de changement de paiement du Point de Vente" + +#. module: pos_payment_change +#: model:ir.model,name:pos_payment_change.model_pos_payment_change_wizard_new_line +msgid "PoS Payment Change Wizard New Line" +msgstr "" +"Nouvelle ligne de l'ssistant de changement de paiement du Point de Vente" + +#. module: pos_payment_change +#: model:ir.model,name:pos_payment_change.model_pos_payment_change_wizard_old_line +msgid "PoS Payment Change Wizard Old Line" +msgstr "" +"Ancienne ligne de l'ssistant de changement de paiement du Point de Vente" + +#. module: pos_payment_change +#: model:ir.model,name:pos_payment_change.model_pos_config +msgid "Point of Sale Configuration" +msgstr "Paramétrage du point de vente" + +#. module: pos_payment_change +#: model:ir.model,name:pos_payment_change.model_pos_order +msgid "Point of Sale Orders" +msgstr "Commandes du point de vente" + +#. module: pos_payment_change +#: selection:pos.config,payment_change_policy:0 +msgid "Refund and Resale" +msgstr "Retourner et revendre" + +#. module: pos_payment_change +#: code:addons/pos_payment_change/models/pos_order.py:43 +#, python-format +msgid "The payments of the Order %s (Ref: %s) has been changed by %s at %s." +msgstr "Les paiements de la commande %s (Réf: %s) ont été changés par %s à %s." + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard__amount_total +#: model_terms:ir.ui.view,arch_db:pos_payment_change.view_pos_payment_change_wizard_form +msgid "Total" +msgstr "Total" + +#. module: pos_payment_change +#: code:addons/pos_payment_change/models/pos_config.py:43 +#, python-format +msgid "" +"Unable to use the 'Update Payments' options for companies that have " +"unalterable accounting." +msgstr "" +"Impossible d'utiliser l'option 'Modifier les paiements' pour les sociétés " +"qui ont une comptabilité inaltérable." + +#. module: pos_payment_change +#: selection:pos.config,payment_change_policy:0 +msgid "Update Payments" +msgstr "Modifier les paiements" + +#. module: pos_payment_change +#: model:ir.model.fields,help:pos_payment_change.field_pos_payment_change_wizard_new_line__company_currency_id +#: model:ir.model.fields,help:pos_payment_change.field_pos_payment_change_wizard_old_line__company_currency_id +msgid "Utility field to express amount currency" +msgstr "" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line__wizard_id +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line__wizard_id +msgid "Wizard" +msgstr "Assistant" + +#. module: pos_payment_change +#: code:addons/pos_payment_change/models/pos_order.py:102 +#, python-format +msgid "" +"You can not change payments of the POS '%s' because the associated session " +"'%s' has been closed!" +msgstr "" +"Vous ne pouvez pas changer les paiements de la Vente '%s' car la session " +"associée '%s' a été clôturé !" diff --git a/pos_payment_change/i18n/it.po b/pos_payment_change/i18n/it.po new file mode 100644 index 0000000000..86f80ebcfa --- /dev/null +++ b/pos_payment_change/i18n/it.po @@ -0,0 +1,246 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_payment_change +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-05-12 12:47+0000\n" +"Last-Translator: Francesco Foresti \n" +"Language-Team: none\n" +"Language: it\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.14.1\n" + +#. module: pos_payment_change +#: code:addons/pos_payment_change/models/pos_order.py:84 +#, python-format +msgid " (Refund Order: %s ; Resale Order: %s)" +msgstr " (Ordine rimborsato: %s ; ordine rivenduto: %s)" + +#. module: pos_payment_change +#: model_terms:ir.ui.view,arch_db:pos_payment_change.view_pos_config_form +msgid "Payment Change Policy" +msgstr "Politica modifica pagamento" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line__amount +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line__amount +msgid "Amount" +msgstr "Valore" + +#. module: pos_payment_change +#: model_terms:ir.ui.view,arch_db:pos_payment_change.view_pos_payment_change_wizard_form +msgid "Cancel" +msgstr "Annulla" + +#. module: pos_payment_change +#: model:ir.actions.act_window,name:pos_payment_change.action_pos_payment_change_wizard +#: model_terms:ir.ui.view,arch_db:pos_payment_change.view_pos_order_form +#: model_terms:ir.ui.view,arch_db:pos_payment_change.view_pos_payment_change_wizard_form +msgid "Change Payments" +msgstr "Modifica pagamenti" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line__company_currency_id +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line__company_currency_id +msgid "Company Currency" +msgstr "Valuta aziendale" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard__create_uid +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line__create_uid +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line__create_uid +msgid "Created by" +msgstr "Creato da" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard__create_date +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line__create_date +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line__create_date +msgid "Created on" +msgstr "Creato il" + +#. module: pos_payment_change +#: code:addons/pos_payment_change/wizards/pos_payment_change_wizard.py:72 +#, python-format +msgid "" +"Differences between the two values for the POS Order '%s':\n" +"\n" +" * Total of all the new payments %s;\n" +" * Total of the POS Order %s;\n" +"\n" +"Please change the payments." +msgstr "" +"Differenze tra i due valori per l'ordine POS '%s':\n" +"\n" +" * Totale di tutti i nuovi pagamenti %s;\n" +" * Totale dell'ordine POS %s;\n" +"\n" +"Si prega di modificare i pagamenti." + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard__display_name +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line__display_name +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line__display_name +msgid "Display Name" +msgstr "Nome visualizzato" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard__id +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line__id +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line__id +msgid "ID" +msgstr "ID" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line__new_journal_id +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line__old_journal_id +msgid "Journal" +msgstr "Registro" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard____last_update +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line____last_update +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line____last_update +msgid "Last Modified on" +msgstr "Ultima modifica il" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard__write_uid +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line__write_uid +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line__write_uid +msgid "Last Updated by" +msgstr "Ultimo aggiornamento di" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard__write_date +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line__write_date +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line__write_date +msgid "Last Updated on" +msgstr "Ultimo aggiornamento il" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard__new_line_ids +msgid "New Payment Lines" +msgstr "Righe nuovo pagamento" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard__old_line_ids +msgid "Old Payment Lines" +msgstr "Righe vecchio pagamento" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard__order_id +msgid "Order" +msgstr "Ordine" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_config__payment_change_policy +msgid "Payment Change Policy" +msgstr "Politica modifica pagamento" + +#. module: pos_payment_change +#: model:ir.model.fields,help:pos_payment_change.field_pos_config__payment_change_policy +msgid "" +"Payment Change Policy when users want to change the payment lines of a given " +"PoS Order.\n" +"* 'Refund and Resale': Odoo will refund the current Pos Order to cancel it, " +"and create a new PoS Order with the correct payment lines.\n" +"* 'Update Payments': Odoo will change payment lines.\n" +"\n" +"Note : In some countries the 'Update Payments' Option is not allowed by law, " +"because orders history shouldn't not be altered." +msgstr "" +"Politica modifica del pagamento quando gli utenti vogliono modificare le " +"righe del pagamento.\n" +"* 'Rimborsa e rivendi': Odoo rimborserà l'ordine PoS attuale per annullarlo " +"e creerà un nuovo ordine PoS con le righe di pagamento corrette.\n" +"* 'Aggiorna pagamenti': Odoo modificherà le righe pagamento.\n" +"\n" +"Nota : in alcune nazioni l'opzione 'Aggiorna pagamenti' non è consentita " +"dalla legge perché lo storico degli ordini non deve essere modificato." + +#. module: pos_payment_change +#: model:ir.model,name:pos_payment_change.model_pos_payment_change_wizard +msgid "PoS Payment Change Wizard" +msgstr "Procedura guidata modifica pagamento PoS" + +#. module: pos_payment_change +#: model:ir.model,name:pos_payment_change.model_pos_payment_change_wizard_new_line +msgid "PoS Payment Change Wizard New Line" +msgstr "Nuova riga procedura guidata modifica pagamento PoS" + +#. module: pos_payment_change +#: model:ir.model,name:pos_payment_change.model_pos_payment_change_wizard_old_line +msgid "PoS Payment Change Wizard Old Line" +msgstr "Vecchia riga procedura guidata modifica pagamento PoS" + +#. module: pos_payment_change +#: model:ir.model,name:pos_payment_change.model_pos_config +msgid "Point of Sale Configuration" +msgstr "Configurazione punto vendita" + +#. module: pos_payment_change +#: model:ir.model,name:pos_payment_change.model_pos_order +msgid "Point of Sale Orders" +msgstr "Ordini punto vendita" + +#. module: pos_payment_change +#: selection:pos.config,payment_change_policy:0 +msgid "Refund and Resale" +msgstr "Rimborsa e rivendi" + +#. module: pos_payment_change +#: code:addons/pos_payment_change/models/pos_order.py:43 +#, python-format +msgid "The payments of the Order %s (Ref: %s) has been changed by %s at %s." +msgstr "" +"Il pagamento dell'ordine %s (Rif: %s) è stato modificato da %s alle %s." + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard__amount_total +#: model_terms:ir.ui.view,arch_db:pos_payment_change.view_pos_payment_change_wizard_form +msgid "Total" +msgstr "Totale" + +#. module: pos_payment_change +#: code:addons/pos_payment_change/models/pos_config.py:43 +#, python-format +msgid "" +"Unable to use the 'Update Payments' options for companies that have " +"unalterable accounting." +msgstr "" +"Impossibile utilizzare l'opzione 'Aggiorna pagamenti' per le nazioni che " +"hanno la contabilità inalterabile." + +#. module: pos_payment_change +#: selection:pos.config,payment_change_policy:0 +msgid "Update Payments" +msgstr "Aggiorna pagamenti" + +#. module: pos_payment_change +#: model:ir.model.fields,help:pos_payment_change.field_pos_payment_change_wizard_new_line__company_currency_id +#: model:ir.model.fields,help:pos_payment_change.field_pos_payment_change_wizard_old_line__company_currency_id +msgid "Utility field to express amount currency" +msgstr "Campo utilità per esprimere la valuta del valore" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line__wizard_id +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line__wizard_id +msgid "Wizard" +msgstr "Procedura guidata" + +#. module: pos_payment_change +#: code:addons/pos_payment_change/models/pos_order.py:102 +#, python-format +msgid "" +"You can not change payments of the POS '%s' because the associated session " +"'%s' has been closed!" +msgstr "" +"Non si possono modificare i pagamenti del POS '%s' perché la sessione " +"associata '%s' è stata chiusa!" diff --git a/pos_payment_change/i18n/pos_payment_change.pot b/pos_payment_change/i18n/pos_payment_change.pot new file mode 100644 index 0000000000..5fbaf1bd9d --- /dev/null +++ b/pos_payment_change/i18n/pos_payment_change.pot @@ -0,0 +1,218 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_payment_change +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-11-06 08:51+0000\n" +"PO-Revision-Date: 2023-11-06 08:51+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_change +#: code:addons/pos_payment_change/models/pos_order.py:84 +#, python-format +msgid " (Refund Order: %s ; Resale Order: %s)" +msgstr "" + +#. module: pos_payment_change +#: model:ir.ui.view,arch_db:pos_payment_change.view_pos_config_form +msgid "Payment Change Policy" +msgstr "" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line_amount +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line_amount +msgid "Amount" +msgstr "" + +#. module: pos_payment_change +#: model:ir.ui.view,arch_db:pos_payment_change.view_pos_payment_change_wizard_form +msgid "Cancel" +msgstr "" + +#. module: pos_payment_change +#: model:ir.actions.act_window,name:pos_payment_change.action_pos_payment_change_wizard +#: model:ir.ui.view,arch_db:pos_payment_change.view_pos_order_form +#: model:ir.ui.view,arch_db:pos_payment_change.view_pos_payment_change_wizard_form +msgid "Change Payments" +msgstr "" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line_company_currency_id +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line_company_currency_id +msgid "Company Currency" +msgstr "" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_create_uid +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line_create_uid +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line_create_uid +msgid "Created by" +msgstr "" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_create_date +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line_create_date +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line_create_date +msgid "Created on" +msgstr "" + +#. module: pos_payment_change +#: code:addons/pos_payment_change/wizards/pos_payment_change_wizard.py:72 +#, python-format +msgid "Differences between the two values for the POS Order '%s':\n" +"\n" +" * Total of all the new payments %s;\n" +" * Total of the POS Order %s;\n" +"\n" +"Please change the payments." +msgstr "" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_display_name +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line_display_name +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line_display_name +msgid "Display Name" +msgstr "" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_id +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line_id +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line_id +msgid "ID" +msgstr "" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line_new_journal_id +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line_old_journal_id +msgid "Journal" +msgstr "" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard___last_update +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line___last_update +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line___last_update +msgid "Last Modified on" +msgstr "" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line_write_uid +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line_write_uid +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_write_uid +msgid "Last Updated by" +msgstr "" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line_write_date +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line_write_date +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_write_date +msgid "Last Updated on" +msgstr "" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line_ids +msgid "New Payment Lines" +msgstr "" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line_ids +msgid "Old Payment Lines" +msgstr "" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_order_id +msgid "Order" +msgstr "" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_config_payment_change_policy +msgid "Payment Change Policy" +msgstr "" + +#. module: pos_payment_change +#: model:ir.model.fields,help:pos_payment_change.field_pos_config_payment_change_policy +msgid "Payment Change Policy when users want to change the payment lines of a given PoS Order.\n" +"* 'Refund and Resale': Odoo will refund the current Pos Order to cancel it, and create a new PoS Order with the correct payment lines.\n" +"* 'Update Payments': Odoo will change payment lines.\n" +"\n" +"Note : In some countries the 'Update Payments' Option is not allowed by law, because orders history shouldn't not be altered." +msgstr "" + +#. module: pos_payment_change +#: model:ir.model,name:pos_payment_change.model_pos_payment_change_wizard +msgid "PoS Payment Change Wizard" +msgstr "" + +#. module: pos_payment_change +#: model:ir.model,name:pos_payment_change.model_pos_payment_change_wizard_new_line +msgid "PoS Payment Change Wizard New Line" +msgstr "" + +#. module: pos_payment_change +#: model:ir.model,name:pos_payment_change.model_pos_payment_change_wizard_old_line +msgid "PoS Payment Change Wizard Old Line" +msgstr "" + +#. module: pos_payment_change +#: model:ir.model,name:pos_payment_change.model_pos_order +msgid "Point of Sale Orders" +msgstr "" + +#. module: pos_payment_change +#: selection:pos.config,payment_change_policy:0 +msgid "Refund and Resale" +msgstr "" + +#. module: pos_payment_change +#: code:addons/pos_payment_change/models/pos_order.py:43 +#, python-format +msgid "The payments of the Order %s (Ref: %s) has been changed by %s at %s." +msgstr "" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_amount_total +#: model:ir.ui.view,arch_db:pos_payment_change.view_pos_payment_change_wizard_form +msgid "Total" +msgstr "" + +#. module: pos_payment_change +#: code:addons/pos_payment_change/models/pos_config.py:43 +#, python-format +msgid "Unable to use the 'Update Payments' options for companies that have unalterable accounting." +msgstr "" + +#. module: pos_payment_change +#: selection:pos.config,payment_change_policy:0 +msgid "Update Payments" +msgstr "" + +#. module: pos_payment_change +#: model:ir.model.fields,help:pos_payment_change.field_pos_payment_change_wizard_new_line_company_currency_id +#: model:ir.model.fields,help:pos_payment_change.field_pos_payment_change_wizard_old_line_company_currency_id +msgid "Utility field to express amount currency" +msgstr "" + +#. module: pos_payment_change +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_new_line_wizard_id +#: model:ir.model.fields,field_description:pos_payment_change.field_pos_payment_change_wizard_old_line_wizard_id +msgid "Wizard" +msgstr "" + +#. module: pos_payment_change +#: code:addons/pos_payment_change/models/pos_order.py:102 +#, python-format +msgid "You can not change payments of the POS '%s' because the associated session '%s' has been closed!" +msgstr "" + +#. module: pos_payment_change +#: model:ir.model,name:pos_payment_change.model_pos_config +msgid "pos.config" +msgstr "" + diff --git a/pos_payment_change/models/__init__.py b/pos_payment_change/models/__init__.py new file mode 100644 index 0000000000..234b311eae --- /dev/null +++ b/pos_payment_change/models/__init__.py @@ -0,0 +1,2 @@ +from . import pos_config +from . import pos_order diff --git a/pos_payment_change/models/pos_config.py b/pos_payment_change/models/pos_config.py new file mode 100644 index 0000000000..2b6d1a78a9 --- /dev/null +++ b/pos_payment_change/models/pos_config.py @@ -0,0 +1,46 @@ +# Copyright (C) 2020 - Today: GRAP (http://www.grap.coop) +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import _, api, fields, models +from odoo.exceptions import ValidationError + + +class PosConfig(models.Model): + _inherit = "pos.config" + + _PAYMENT_CHANGE_POLICY_SELECTION = [ + ('refund', "Refund and Resale"), + ('update', "Update Payments"), + ] + + payment_change_policy = fields.Selection( + selection=_PAYMENT_CHANGE_POLICY_SELECTION, + default="refund", required=True, + help="Payment Change Policy when users want" + " to change the payment lines of a given PoS Order.\n" + "* 'Refund and Resale': Odoo will refund the current" + " Pos Order to cancel it, and create a new PoS Order" + " with the correct payment lines.\n" + "* 'Update Payments': Odoo will change payment lines.\n\n" + "Note : In some countries the 'Update Payments' Option" + " is not allowed by law, because orders history shouldn't" + " not be altered.") + + @api.constrains("payment_change_policy") + def _check_payment_change_policy(self): + # Check if certification module is installed + # and if yes, if 'update payments' option is allowed + module_states = self.env["ir.module.module"].sudo().search([ + ("name", "=", "l10n_fr_certification")] + ).mapped("state") + if "installed" not in module_states: + return + for config in self.filtered( + lambda x: x.payment_change_policy == "update" + ): + if config.company_id._is_accounting_unalterable(): + raise ValidationError(_( + "Unable to use the 'Update Payments' options" + " for companies that have unalterable accounting." + )) diff --git a/pos_payment_change/models/pos_order.py b/pos_payment_change/models/pos_order.py new file mode 100644 index 0000000000..f16d1e6103 --- /dev/null +++ b/pos_payment_change/models/pos_order.py @@ -0,0 +1,105 @@ +# Copyright (C) 2015 - Today: GRAP (http://www.grap.coop) +# @author: Julien WESTE +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from datetime import datetime + +from odoo import _, api, models +from odoo.tools import float_is_zero +from odoo.exceptions import Warning as UserError + + +class PosOrder(models.Model): + _inherit = "pos.order" + + @api.multi + def change_payment(self, payment_lines): + """ + Change payment of a given order. + payment_lines should be a list of data that are + the argument of the Odoo Core function add_payment() + Return a list of order ids, depending on the + payment_change_policy of the related pos_config. + """ + self.ensure_one() + orders = self + + # Removing zero lines + precision = self.pricelist_id.currency_id.decimal_places + payment_lines = [ + x for x in payment_lines if not float_is_zero( + x["amount"], precision_digits=precision) + ] + + self._check_payment_change_allowed() + + comment = _( + "The payments of the Order %s (Ref: %s) has been changed" + " by %s at %s." % ( + self.name, + self.pos_reference, + self.env.user.name, + datetime.today(), + ) + ) + + if self.config_id.payment_change_policy == "update": + self.sudo().statement_ids.with_context().unlink() + + # Create new payment + for line in payment_lines: + self.add_payment(line) + + elif self.config_id.payment_change_policy == "refund": + # Refund order and mark it as paid + # with same payment method as the original one + refund_result = self.refund() + refund_order = self.browse(refund_result["res_id"]) + + refund_order.write({ + "date_order": self.date_order, + "session_id": self.session_id.id, + }) + + for statement in self.statement_ids: + refund_order.add_payment({ + "journal": statement.journal_id.id, + "amount": - statement.amount, + "payment_date": self.date_order, + }) + refund_order.action_pos_order_paid() + + # Resale order and mark it as paid + # with the new payment + resale_order = self.copy( + default={"pos_reference": self.pos_reference} + ) + + for line in payment_lines: + resale_order.add_payment(line) + resale_order.action_pos_order_paid() + + orders += refund_order + resale_order + comment += _(" (Refund Order: %s ; Resale Order: %s)" % ( + refund_order.name, resale_order.name)) + for order in orders: + order.note = "%s\n%s" % (order.note or "", comment) + return orders + + @api.multi + def _check_payment_change_allowed(self): + """Return True if the user can change the payment of a POS, depending + of the state of the current session.""" + closed_orders = self.filtered(lambda x: x.session_id.state == "closed") + if len(closed_orders): + raise UserError( + _( + "You can not change payments of the POS '%s' because" + " the associated session '%s' has been closed!" + % ( + ", ".join(closed_orders.mapped("name")), + ", ".join(closed_orders.mapped("session_id.name")), + ) + ) + ) diff --git a/pos_payment_change/readme/CONFIGURE.rst b/pos_payment_change/readme/CONFIGURE.rst new file mode 100644 index 0000000000..fd1eba8dbb --- /dev/null +++ b/pos_payment_change/readme/CONFIGURE.rst @@ -0,0 +1,23 @@ +* Go to Point of Sale > Configuration > Point of Sale +* Edit your point of sale, and select a value for the field + 'Payment Change Policy'. + +Two options are available: + +* 'Refund and Resale': Odoo will refund the current + Pos Order to cancel it, and create a new PoS Order + with the correct payment lines + +* 'Update Payments': Odoo will change payment lines. + +.. figure:: ../static/description/pos_config_form.png + + +**Note** +In some countries the 'Update Payments' Option +is not allowed by law, because orders history shouldn't not be altered. + +For that purpose, a constrains is present to check the value of this +field. If the module ``l10n_fr_certification`` is installed and if the +current company has an inalterable accounting, it will not be possible +to select the value 'Update Payments'. diff --git a/pos_payment_change/readme/CONTRIBUTORS.rst b/pos_payment_change/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..7754037b21 --- /dev/null +++ b/pos_payment_change/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* Sylvain LE GAL +* Julien WESTE diff --git a/pos_payment_change/readme/CREDITS.rst b/pos_payment_change/readme/CREDITS.rst new file mode 100644 index 0000000000..4832a8457f --- /dev/null +++ b/pos_payment_change/readme/CREDITS.rst @@ -0,0 +1,4 @@ +The development of this module has been financially supported by: + +* GRAP, Groupement Régional Alimentaire de proximité (www.grap.coop) +* Vracoop (www.vracoop.fr) diff --git a/pos_payment_change/readme/DESCRIPTION.rst b/pos_payment_change/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..f725ca719c --- /dev/null +++ b/pos_payment_change/readme/DESCRIPTION.rst @@ -0,0 +1,6 @@ +This module extends the functionnality of the Odoo Point of Sale to +allow the cashier to change the payments of a PoS order. + +This feature is usefull when the user realized that he did a mistake, +just after he marked the order as paid, or during the close of the session, +Only if entries has not been generated. diff --git a/pos_payment_change/readme/USAGE.rst b/pos_payment_change/readme/USAGE.rst new file mode 100644 index 0000000000..604022c883 --- /dev/null +++ b/pos_payment_change/readme/USAGE.rst @@ -0,0 +1,19 @@ +* Go to a PoS Order + +* Click on the button 'Change Payments' + +.. figure:: ../static/description/pos_order_form.png + +* In the pop up wizard, select the real payment(s) that have been + used to pay the order + +.. figure:: ../static/description/pos_payment_change_wizard_form.png + +* Then click on the button 'Change Payments' + +**Note** + +If the option 'Refund and Resale' is selected, changing the payments will +display the three PoS orders. the oringal one, the refund one, and the new one. + +.. figure:: ../static/description/pos_order_tree.png diff --git a/pos_payment_change/static/description/icon.png b/pos_payment_change/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/pos_payment_change/static/description/icon.png differ diff --git a/pos_payment_change/static/description/index.html b/pos_payment_change/static/description/index.html new file mode 100644 index 0000000000..9081a3db05 --- /dev/null +++ b/pos_payment_change/static/description/index.html @@ -0,0 +1,490 @@ + + + + + + +Point Of Sale - Change Payments + + + +
+

Point Of Sale - Change Payments

+ + +

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

+

This module extends the functionnality of the Odoo Point of Sale to +allow the cashier to change the payments of a PoS order.

+

This feature is usefull when the user realized that he did a mistake, +just after he marked the order as paid, or during the close of the session, +Only if entries has not been generated.

+

Table of contents

+ +
+

Configuration

+
    +
  • Go to Point of Sale > Configuration > Point of Sale
  • +
  • Edit your point of sale, and select a value for the field +‘Payment Change Policy’.
  • +
+

Two options are available:

+
    +
  • ‘Refund and Resale’: Odoo will refund the current +Pos Order to cancel it, and create a new PoS Order +with the correct payment lines
  • +
  • ‘Update Payments’: Odoo will change payment lines.
  • +
+
+https://raw.githubusercontent.com/OCA/pos/12.0/pos_payment_change/static/description/pos_config_form.png +
+

Note +In some countries the ‘Update Payments’ Option +is not allowed by law, because orders history shouldn’t not be altered.

+

For that purpose, a constrains is present to check the value of this +field. If the module l10n_fr_certification is installed and if the +current company has an inalterable accounting, it will not be possible +to select the value ‘Update Payments’.

+
+
+

Usage

+
    +
  • Go to a PoS Order
  • +
  • Click on the button ‘Change Payments’
  • +
+
+https://raw.githubusercontent.com/OCA/pos/12.0/pos_payment_change/static/description/pos_order_form.png +
+
    +
  • In the pop up wizard, select the real payment(s) that have been +used to pay the order
  • +
+
+https://raw.githubusercontent.com/OCA/pos/12.0/pos_payment_change/static/description/pos_payment_change_wizard_form.png +
+
    +
  • Then click on the button ‘Change Payments’
  • +
+

Note

+

If the option ‘Refund and Resale’ is selected, changing the payments will +display the three PoS orders. the oringal one, the refund one, and the new one.

+
+https://raw.githubusercontent.com/OCA/pos/12.0/pos_payment_change/static/description/pos_order_tree.png +
+
+
+

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

+
    +
  • GRAP
  • +
+
+
+

Contributors

+ +
+
+

Other credits

+

The development of this module has been financially supported by:

+
    +
  • GRAP, Groupement Régional Alimentaire de proximité (www.grap.coop)
  • +
  • Vracoop (www.vracoop.fr)
  • +
+
+
+

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.

+

Current maintainer:

+

legalsylvain

+

This module is part of the OCA/pos project on GitHub.

+

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

+
+
+
+ + diff --git a/pos_payment_change/static/description/pos_config_form.png b/pos_payment_change/static/description/pos_config_form.png new file mode 100644 index 0000000000..d47d0de851 Binary files /dev/null and b/pos_payment_change/static/description/pos_config_form.png differ diff --git a/pos_payment_change/static/description/pos_order_form.png b/pos_payment_change/static/description/pos_order_form.png new file mode 100644 index 0000000000..ff51607870 Binary files /dev/null and b/pos_payment_change/static/description/pos_order_form.png differ diff --git a/pos_payment_change/static/description/pos_order_tree.png b/pos_payment_change/static/description/pos_order_tree.png new file mode 100644 index 0000000000..24e29f1623 Binary files /dev/null and b/pos_payment_change/static/description/pos_order_tree.png differ diff --git a/pos_payment_change/static/description/pos_payment_change_wizard_form.png b/pos_payment_change/static/description/pos_payment_change_wizard_form.png new file mode 100644 index 0000000000..3411fa491d Binary files /dev/null and b/pos_payment_change/static/description/pos_payment_change_wizard_form.png differ diff --git a/pos_payment_change/tests/__init__.py b/pos_payment_change/tests/__init__.py new file mode 100644 index 0000000000..d9b96c4fa5 --- /dev/null +++ b/pos_payment_change/tests/__init__.py @@ -0,0 +1 @@ +from . import test_module diff --git a/pos_payment_change/tests/test_module.py b/pos_payment_change/tests/test_module.py new file mode 100644 index 0000000000..a27d430e34 --- /dev/null +++ b/pos_payment_change/tests/test_module.py @@ -0,0 +1,172 @@ +# Copyright (C) 2018 - Today: GRAP (http://www.grap.coop) +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields +from odoo.tests.common import TransactionCase +from odoo.exceptions import UserError + + +class TestModule(TransactionCase): + """Tests for 'Point of Sale - Change Payment' Module""" + + def setUp(self): + super().setUp() + self.PosSession = self.env["pos.session"] + self.PosOrder = self.env["pos.order"] + self.AccountJournal = self.env["account.journal"] + self.PosMakePayment = self.env['pos.make.payment'] + self.PosPaymentChangeWizard = self.env["pos.payment.change.wizard"] + self.PosPaymentChangeWizardNewLine = self.env[ + "pos.payment.change.wizard.new.line" + ] + self.product = self.env.ref("product.product_product_3") + self.pos_config = self.env.ref("point_of_sale.pos_config_main").copy() + + def _initialize_journals_open_session(self): + + self.check_journal = self.AccountJournal.create({ + "name": "Demo Check Journal", + "type": "bank", + "journal_user": True, + }) + self.cash_journal = self.AccountJournal.create({ + "name": "Demo Cash Journal", + "type": "cash", + "journal_user": True, + }) + + # create new session and open it + self.pos_config.journal_ids = [ + self.check_journal.id, + self.cash_journal.id, + ] + self.pos_config.open_session_cb() + self.session = self.pos_config.current_session_id + self.check_statement = self.session.statement_ids.filtered( + lambda x: x.journal_id == self.check_journal + ) + self.cash_statement = self.session.statement_ids.filtered( + lambda x: x.journal_id == self.cash_journal + ) + + def _sale(self, journal_1, price_1, journal_2=False, price_2=0.0): + price = price_1 + price_2 + line_vals = { + "name": "OL/0001", + "product_id": self.product.id, + "qty": 1.0, + "price_unit": price, + "price_subtotal": price, + "price_subtotal_incl": price, + } + order = self.PosOrder.create({ + "session_id": self.session.id, + "amount_tax": 0, + "amount_total": price, + "amount_paid": price, + "amount_return": 0, + "lines": [[0, False, line_vals]], + }) + order.add_payment({ + 'amount': price_1, + 'payment_date': fields.Date.today(), + 'payment_name': "Demo", + 'journal': journal_1.id, + }) + if journal_2: + order.add_payment({ + 'amount': price_2, + 'payment_date': fields.Date.today(), + 'payment_name': "Demo", + 'journal': journal_2.id, + }) + order.action_pos_order_paid() + return order + + def _change_payment( + self, order, journal_1, amount_1, journal_2=False, amount_2=0.0 + ): + # Switch to check journal + wizard = self.PosPaymentChangeWizard.with_context( + active_id=order.id + ).create({}) + self.PosPaymentChangeWizardNewLine.with_context( + active_id=order.id + ).create( + { + "wizard_id": wizard.id, + "new_journal_id": journal_1.id, + "amount": amount_1, + } + ) + if journal_2: + self.PosPaymentChangeWizardNewLine.with_context( + active_id=order.id + ).create( + { + "wizard_id": wizard.id, + "new_journal_id": journal_2.id, + "amount": amount_2, + } + ) + wizard.button_change_payment() + + # Test Section + def test_01_payment_change_policy_update(self): + self.pos_config.payment_change_policy = "update" + + self._initialize_journals_open_session() + # Make a sale with 35 in cash journal and 65 in check + order = self._sale(self.cash_journal, 35, self.check_journal, 65) + + order_qty = len(self.PosOrder.search([])) + + with self.assertRaises(UserError): + # Should not work if total is not correct + self._change_payment( + order, self.cash_journal, 10, self.check_journal, 10) + + self._change_payment( + order, self.cash_journal, 10, self.check_journal, 90) + + # check Session + self.assertEqual( + self.cash_statement.balance_end, + 10, + "Bad recompute of the balance for the statement cash", + ) + + self.assertEqual( + self.check_statement.balance_end, + 90, + "Bad recompute of the balance for the statement check", + ) + + # Check Order quantity + self.assertEqual( + order_qty, + len(self.PosOrder.search([])), + "In 'Update' mode, changing payment should not create" + " other PoS Orders", + ) + + def test_02_payment_change_policy_refund(self): + self.pos_config.payment_change_policy = "refund" + + self._initialize_journals_open_session() + # Make a sale with 35 in cash journal and 65 in check + order = self._sale(self.cash_journal, 35, self.check_journal, 65) + + order_qty = len(self.PosOrder.search([])) + + self._change_payment( + order, self.cash_journal, 50, self.check_journal, 50) + + # Check Order quantity + self.assertEqual( + order_qty + 2, + len(self.PosOrder.search([])), + "In 'Refund' mode, changing payment should generate" + " two new PoS Orders", + ) diff --git a/pos_payment_change/views/view_pos_config.xml b/pos_payment_change/views/view_pos_config.xml new file mode 100644 index 0000000000..8fa4bcdc12 --- /dev/null +++ b/pos_payment_change/views/view_pos_config.xml @@ -0,0 +1,29 @@ + + + + + + + pos.config + + + +
+
+ Payment Change Policy +
+ +
+
+
+
+
+
+ +
diff --git a/pos_payment_change/views/view_pos_order.xml b/pos_payment_change/views/view_pos_order.xml new file mode 100644 index 0000000000..701ec7888e --- /dev/null +++ b/pos_payment_change/views/view_pos_order.xml @@ -0,0 +1,21 @@ + + + + + + + pos.order + + + + + + diff --git a/pos_payment_change/wizards/__init__.py b/pos_payment_change/wizards/__init__.py new file mode 100644 index 0000000000..6aff511ae0 --- /dev/null +++ b/pos_payment_change/wizards/__init__.py @@ -0,0 +1,3 @@ +from . import pos_payment_change_wizard +from . import pos_payment_change_wizard_new_line +from . import pos_payment_change_wizard_old_line diff --git a/pos_payment_change/wizards/pos_payment_change_wizard.py b/pos_payment_change/wizards/pos_payment_change_wizard.py new file mode 100644 index 0000000000..683b46b711 --- /dev/null +++ b/pos_payment_change/wizards/pos_payment_change_wizard.py @@ -0,0 +1,101 @@ +# Copyright (C) 2015-Today GRAP (http://www.grap.coop) +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import _, api, fields, models +from odoo.tools import float_is_zero +from odoo.exceptions import Warning as UserError + + +class PosPaymentChangeWizard(models.TransientModel): + _name = "pos.payment.change.wizard" + _description = "PoS Payment Change Wizard" + + # Column Section + order_id = fields.Many2one( + comodel_name="pos.order", string="Order", readonly=True + ) + + old_line_ids = fields.One2many( + comodel_name="pos.payment.change.wizard.old.line", + inverse_name="wizard_id", + string="Old Payment Lines", + readonly=True, + ) + + new_line_ids = fields.One2many( + comodel_name="pos.payment.change.wizard.new.line", + inverse_name="wizard_id", + string="New Payment Lines", + ) + + amount_total = fields.Float(string="Total", readonly=True) + + # View Section + @api.model + def default_get(self, fields): + PosOrder = self.env["pos.order"] + res = super().default_get(fields) + order = PosOrder.browse(self._context.get("active_id")) + old_lines_vals = [] + for statement_line in order.statement_ids: + old_lines_vals.append((0, 0, { + "old_journal_id": statement_line.statement_id.journal_id.id, + "amount": statement_line.amount + } + )) + res.update({ + "order_id": order.id, + "amount_total": order.amount_total, + "old_line_ids": old_lines_vals, + }) + return res + + # View section + @api.multi + def button_change_payment(self): + self.ensure_one() + order = self.order_id + + # Check if the total is correct + total = sum(self.mapped("new_line_ids.amount")) + precision = order.pricelist_id.currency_id.decimal_places + if not float_is_zero( + self.amount_total - total, precision_digits=precision): + raise UserError( + _( + "Differences between the two values for the POS" + " Order '%s':\n\n" + " * Total of all the new payments %s;\n" + " * Total of the POS Order %s;\n\n" + "Please change the payments." + % (order.name, total, order.amount_total) + ) + ) + + # Change payment + new_payments = [{ + "journal": line.new_journal_id.id, + "amount": line.amount, + "payment_date": self.order_id.date_order, + } for line in self.new_line_ids] + + orders = order.change_payment(new_payments) + + # Note. Because of the poor design of the closing session process + # in Odoo, we call _check_pos_session_balance() that sets + # balance_end_real with balance_end for "non cash" journals + if order.session_id.state == "closing_control": + order.session_id._check_pos_session_balance() + + if len(orders) == 1: + # if policy is 'update', only close the pop up + action = {'type': 'ir.actions.act_window_close'} + else: + # otherwise (refund policy), displays the 3 orders + action = self.env.ref( + "point_of_sale.action_pos_pos_form" + ).read()[0] + action['domain'] = [('id', 'in', orders.ids)] + + return action diff --git a/pos_payment_change/wizards/pos_payment_change_wizard_new_line.py b/pos_payment_change/wizards/pos_payment_change_wizard_new_line.py new file mode 100644 index 0000000000..8fd3f21a81 --- /dev/null +++ b/pos_payment_change/wizards/pos_payment_change_wizard_new_line.py @@ -0,0 +1,57 @@ +# Copyright (C) 2015 - Today: GRAP (http://www.grap.coop) +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import api, fields, models + + +class PosPaymentChangeWizardLine(models.TransientModel): + _name = "pos.payment.change.wizard.new.line" + _description = "PoS Payment Change Wizard New Line" + + wizard_id = fields.Many2one( + comodel_name="pos.payment.change.wizard", required=True, + ondelete='cascade' + ) + + new_journal_id = fields.Many2one( + comodel_name="account.journal", + string="Journal", + required=True, + domain=lambda s: s._domain_new_journal_id(), + ) + + company_currency_id = fields.Many2one( + comodel_name='res.currency', store=True, + related='new_journal_id.currency_id', + string="Company Currency", readonly=True, + help='Utility field to express amount currency' + ) + + amount = fields.Monetary( + string="Amount", + required=True, default=0.0, + currency_field='company_currency_id' + ) + + @api.model + def _domain_new_journal_id(self): + PosOrder = self.env["pos.order"] + order = PosOrder.browse(self.env.context.get("active_id")) + return [("id", "in", order.mapped( + "session_id.statement_ids.journal_id").ids)] + + # View Section + @api.model + def default_get(self, fields): + res = super().default_get(fields) + if "new_line_ids" not in self._context: + return res + balance = self._context.get("amount_total", 0.0) + for line in self.wizard_id.resolve_2many_commands( + "new_line_ids", + self._context["new_line_ids"], + fields=["amount"]): + balance -= line.get("amount") + res.update({'amount': balance}) + return res diff --git a/pos_payment_change/wizards/pos_payment_change_wizard_old_line.py b/pos_payment_change/wizards/pos_payment_change_wizard_old_line.py new file mode 100644 index 0000000000..4256dfc5a9 --- /dev/null +++ b/pos_payment_change/wizards/pos_payment_change_wizard_old_line.py @@ -0,0 +1,36 @@ +# Copyright (C) 2015 - Today: GRAP (http://www.grap.coop) +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class PosPaymentChangeWizardOldLine(models.TransientModel): + _name = "pos.payment.change.wizard.old.line" + _description = "PoS Payment Change Wizard Old Line" + + wizard_id = fields.Many2one( + comodel_name="pos.payment.change.wizard", required=True, + ondelete='cascade' + ) + + old_journal_id = fields.Many2one( + comodel_name="account.journal", + string="Journal", + required=True, + readonly=True, + ) + + company_currency_id = fields.Many2one( + comodel_name='res.currency', store=True, + related='old_journal_id.currency_id', + string="Company Currency", readonly=True, + help='Utility field to express amount currency' + ) + + amount = fields.Monetary( + string="Amount", + required=True, + readonly=True, default=0.0, + currency_field='company_currency_id' + ) diff --git a/pos_payment_change/wizards/view_pos_payment_change_wizard.xml b/pos_payment_change/wizards/view_pos_payment_change_wizard.xml new file mode 100644 index 0000000000..e888fef112 --- /dev/null +++ b/pos_payment_change/wizards/view_pos_payment_change_wizard.xml @@ -0,0 +1,49 @@ + + + + + + + pos.payment.change.wizard + +
+ + + + + + + + + + + + + + + + + +
+
+
+
+
+ + + Change Payments + pos.payment.change.wizard + form + form + new + + +
diff --git a/setup/pos_payment_change/odoo/addons/pos_payment_change b/setup/pos_payment_change/odoo/addons/pos_payment_change new file mode 120000 index 0000000000..6758108b45 --- /dev/null +++ b/setup/pos_payment_change/odoo/addons/pos_payment_change @@ -0,0 +1 @@ +../../../../pos_payment_change \ No newline at end of file diff --git a/setup/pos_payment_change/setup.cfg b/setup/pos_payment_change/setup.cfg new file mode 100644 index 0000000000..3c6e79cf31 --- /dev/null +++ b/setup/pos_payment_change/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/setup/pos_payment_change/setup.py b/setup/pos_payment_change/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/pos_payment_change/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)