From dea747e053d825abf52280e17810dc65d9dc1b63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julen=20Z=C3=A1rate=20Ruiz?= Date: Mon, 20 Feb 2023 23:48:13 +0100 Subject: [PATCH] [MIG] pos_payment_change: Migration to 16.0 --- pos_payment_change/README.rst | 16 ++++++++-------- pos_payment_change/__manifest__.py | 2 +- pos_payment_change/static/description/index.html | 14 +++++++------- pos_payment_change/tests/test_module.py | 16 +++++++++++++++- 4 files changed, 31 insertions(+), 17 deletions(-) diff --git a/pos_payment_change/README.rst b/pos_payment_change/README.rst index 33f03994e1..f131f00135 100644 --- a/pos_payment_change/README.rst +++ b/pos_payment_change/README.rst @@ -14,13 +14,13 @@ Point Of Sale - Change Payments :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/15.0/pos_payment_change + :target: https://github.com/OCA/pos/tree/16.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-15-0/pos-15-0-pos_payment_change :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/184/15.0 + :target: https://runbot.odoo-community.org/runbot/184/16.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -52,7 +52,7 @@ Two options are available: * 'Update Payments': Odoo will change payment lines. -.. figure:: https://raw.githubusercontent.com/OCA/pos/15.0/pos_payment_change/static/description/pos_config_form.png +.. figure:: https://raw.githubusercontent.com/OCA/pos/16.0/pos_payment_change/static/description/pos_config_form.png **Note** @@ -71,12 +71,12 @@ Usage * Click on the button 'Change Payments' -.. figure:: https://raw.githubusercontent.com/OCA/pos/15.0/pos_payment_change/static/description/pos_order_form.png +.. figure:: https://raw.githubusercontent.com/OCA/pos/16.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/15.0/pos_payment_change/static/description/pos_payment_change_wizard_form.png +.. figure:: https://raw.githubusercontent.com/OCA/pos/16.0/pos_payment_change/static/description/pos_payment_change_wizard_form.png * Then click on the button 'Change Payments' @@ -85,7 +85,7 @@ Usage 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/15.0/pos_payment_change/static/description/pos_order_tree.png +.. figure:: https://raw.githubusercontent.com/OCA/pos/16.0/pos_payment_change/static/description/pos_order_tree.png Bug Tracker =========== @@ -93,7 +93,7 @@ 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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -142,6 +142,6 @@ Current `maintainer `__: |maintainer-legalsylvain| -This module is part of the `OCA/pos `_ project on GitHub. +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/__manifest__.py b/pos_payment_change/__manifest__.py index d160447462..094688efd5 100644 --- a/pos_payment_change/__manifest__.py +++ b/pos_payment_change/__manifest__.py @@ -3,7 +3,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Point Of Sale - Change Payments", - "version": "15.0.1.0.0", + "version": "16.0.1.0.0", "summary": "Allow cashier to change order payments, as long as" " the session is not closed.", "category": "Point Of Sale", diff --git a/pos_payment_change/static/description/index.html b/pos_payment_change/static/description/index.html index 5019e263fe..cb6a49fef1 100644 --- a/pos_payment_change/static/description/index.html +++ b/pos_payment_change/static/description/index.html @@ -367,7 +367,7 @@

Point Of Sale - Change Payments

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

+

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

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, @@ -403,7 +403,7 @@

Configuration

  • ‘Update Payments’: Odoo will change payment lines.
  • -https://raw.githubusercontent.com/OCA/pos/15.0/pos_payment_change/static/description/pos_config_form.png +https://raw.githubusercontent.com/OCA/pos/16.0/pos_payment_change/static/description/pos_config_form.png

    Note In some countries the ‘Update Payments’ Option @@ -420,14 +420,14 @@

    Usage

  • Click on the button ‘Change Payments’
  • -https://raw.githubusercontent.com/OCA/pos/15.0/pos_payment_change/static/description/pos_order_form.png +https://raw.githubusercontent.com/OCA/pos/16.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/15.0/pos_payment_change/static/description/pos_payment_change_wizard_form.png +https://raw.githubusercontent.com/OCA/pos/16.0/pos_payment_change/static/description/pos_payment_change_wizard_form.png
    • Then click on the button ‘Change Payments’
    • @@ -436,7 +436,7 @@

      Usage

      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/15.0/pos_payment_change/static/description/pos_order_tree.png +https://raw.githubusercontent.com/OCA/pos/16.0/pos_payment_change/static/description/pos_order_tree.png
      @@ -444,7 +444,7 @@

      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.

      +feedback.

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

      @@ -481,7 +481,7 @@

      Maintainers

      promote its widespread use.

      Current maintainer:

      legalsylvain

      -

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

      +

      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/tests/test_module.py b/pos_payment_change/tests/test_module.py index 9ff46e2e1f..2adfa80341 100644 --- a/pos_payment_change/tests/test_module.py +++ b/pos_payment_change/tests/test_module.py @@ -51,7 +51,7 @@ def _initialize_journals_open_session(self): self.bank_payment_method.id, self.cash_payment_method.id, ] - self.pos_config.open_session_cb() + self.pos_config.open_ui() self.session = self.pos_config.current_session_id def _sale(self, payment_method_1, price_1, payment_method_2=False, price_2=0.0): @@ -181,3 +181,17 @@ def test_02_payment_change_policy_refund(self): len(self.PosOrder.search([])), "In 'Refund' mode, changing payment should generate" " two new PoS Orders", ) + + def test_03_payment_change_closed_orders(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_payment_method, 35, self.bank_payment_method, 65) + + self.session.state = "closed" + + with self.assertRaises(UserError): + self._change_payment( + order, self.cash_payment_method, 10, self.bank_payment_method, 90 + ) \ No newline at end of file