From d86238d0a8d1f3d02a88c97deef9a5ee47d57f94 Mon Sep 17 00:00:00 2001 From: Victor Feyens Date: Tue, 24 Jan 2023 16:47:32 +0000 Subject: [PATCH] [MOV] acc_pay_patch->acc_pay: merge bugfix module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The module ´account_payment_invoice_online_payment_patch´ was added in stable to allow account_payment users to disable online invoice payment (without removing the module, critical for other flows). It can be safely merged into the account_payment module for future versions. Original bugfix PR: #110177 Related to opw-3114860 Part-of: odoo/odoo#111046 --- addons/account_payment/__manifest__.py | 3 + .../data/ir_config_parameter.xml | 0 addons/account_payment/models/account_move.py | 7 +- .../views/account_portal_templates.xml | 58 +++++---- addons/account_payment/wizards/__init__.py | 1 + .../wizards/res_config_settings.py | 0 .../wizards/res_config_settings_views.xml | 0 .../__init__.py | 4 - .../__manifest__.py | 16 --- .../i18n/account_payment_extension.pot | 111 ------------------ .../models/__init__.py | 3 - .../models/account_move.py | 16 --- .../views/account_portal_templates.xml | 65 ---------- .../wizards/__init__.py | 3 - 14 files changed, 46 insertions(+), 241 deletions(-) rename addons/{account_payment_invoice_online_payment_patch => account_payment}/data/ir_config_parameter.xml (100%) rename addons/{account_payment_invoice_online_payment_patch => account_payment}/wizards/res_config_settings.py (100%) rename addons/{account_payment_invoice_online_payment_patch => account_payment}/wizards/res_config_settings_views.xml (100%) delete mode 100644 addons/account_payment_invoice_online_payment_patch/__init__.py delete mode 100644 addons/account_payment_invoice_online_payment_patch/__manifest__.py delete mode 100644 addons/account_payment_invoice_online_payment_patch/i18n/account_payment_extension.pot delete mode 100644 addons/account_payment_invoice_online_payment_patch/models/__init__.py delete mode 100644 addons/account_payment_invoice_online_payment_patch/models/account_move.py delete mode 100644 addons/account_payment_invoice_online_payment_patch/views/account_portal_templates.xml delete mode 100644 addons/account_payment_invoice_online_payment_patch/wizards/__init__.py diff --git a/addons/account_payment/__manifest__.py b/addons/account_payment/__manifest__.py index ddd1d153e14..8b5068b930c 100644 --- a/addons/account_payment/__manifest__.py +++ b/addons/account_payment/__manifest__.py @@ -8,6 +8,8 @@ 'depends': ['account', 'payment'], 'auto_install': ['account'], 'data': [ + 'data/ir_config_parameter.xml', + 'security/ir.model.access.csv', 'security/ir_rules.xml', @@ -23,6 +25,7 @@ 'wizards/account_payment_register_views.xml', 'wizards/payment_link_wizard_views.xml', 'wizards/payment_refund_wizard_views.xml', + 'wizards/res_config_settings_views.xml', ], 'assets': { 'web.assets_frontend': [ diff --git a/addons/account_payment_invoice_online_payment_patch/data/ir_config_parameter.xml b/addons/account_payment/data/ir_config_parameter.xml similarity index 100% rename from addons/account_payment_invoice_online_payment_patch/data/ir_config_parameter.xml rename to addons/account_payment/data/ir_config_parameter.xml diff --git a/addons/account_payment/models/account_move.py b/addons/account_payment/models/account_move.py index f5b2fc4fe29..5cc680f5579 100644 --- a/addons/account_payment/models/account_move.py +++ b/addons/account_payment/models/account_move.py @@ -41,7 +41,12 @@ class AccountMove(models.Model): def _has_to_be_paid(self): self.ensure_one() transactions = self.transaction_ids.filtered(lambda tx: tx.state in ('authorized', 'done')) - return bool( + enabled_feature = str2bool( + self.env['ir.config_parameter'].sudo().get_param( + 'account_payment.enable_portal_payment' + ) + ) + return enabled_feature and bool( ( self.amount_residual # FIXME someplace we check amount_residual and some other amount_paid < amount_total diff --git a/addons/account_payment/views/account_portal_templates.xml b/addons/account_payment/views/account_portal_templates.xml index 14aa3c37604..46582491b06 100644 --- a/addons/account_payment/views/account_portal_templates.xml +++ b/addons/account_payment/views/account_portal_templates.xml @@ -5,9 +5,7 @@ - - - Pay Now @@ -16,23 +14,40 @@ - - Waiting for Payment + + + Waiting for Payment + + + Authorized + + + Pending + + + Paid + + + Reversed + + + Cancelled + - - Authorized - - - Pending - - - Paid - - - Reversed - - - Cancelled + + + + Waiting for Payment + + + Paid + + + Reversed + + + Cancelled + @@ -70,8 +85,7 @@
- Pay Now @@ -90,7 +104,7 @@
-
+
diff --git a/addons/account_payment/wizards/__init__.py b/addons/account_payment/wizards/__init__.py index e70f90e09ce..e2bc93a82dc 100644 --- a/addons/account_payment/wizards/__init__.py +++ b/addons/account_payment/wizards/__init__.py @@ -3,3 +3,4 @@ from . import account_payment_register from . import payment_link_wizard from . import payment_refund_wizard +from . import res_config_settings diff --git a/addons/account_payment_invoice_online_payment_patch/wizards/res_config_settings.py b/addons/account_payment/wizards/res_config_settings.py similarity index 100% rename from addons/account_payment_invoice_online_payment_patch/wizards/res_config_settings.py rename to addons/account_payment/wizards/res_config_settings.py diff --git a/addons/account_payment_invoice_online_payment_patch/wizards/res_config_settings_views.xml b/addons/account_payment/wizards/res_config_settings_views.xml similarity index 100% rename from addons/account_payment_invoice_online_payment_patch/wizards/res_config_settings_views.xml rename to addons/account_payment/wizards/res_config_settings_views.xml diff --git a/addons/account_payment_invoice_online_payment_patch/__init__.py b/addons/account_payment_invoice_online_payment_patch/__init__.py deleted file mode 100644 index 878f71004eb..00000000000 --- a/addons/account_payment_invoice_online_payment_patch/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# Part of Odoo. See LICENSE file for full copyright and licensing details. - -from . import models -from . import wizards diff --git a/addons/account_payment_invoice_online_payment_patch/__manifest__.py b/addons/account_payment_invoice_online_payment_patch/__manifest__.py deleted file mode 100644 index 013ad7766e1..00000000000 --- a/addons/account_payment_invoice_online_payment_patch/__manifest__.py +++ /dev/null @@ -1,16 +0,0 @@ -# Part of Odoo. See LICENSE file for full copyright and licensing details. - -{ - 'name': "Payment - Account / Invoice Online Payment Patch", - 'category': 'Accounting/Accounting', - 'depends': ['account_payment'], - 'auto_install': True, - 'data': [ - 'data/ir_config_parameter.xml', - - 'views/account_portal_templates.xml', - - 'wizards/res_config_settings_views.xml', - ], - 'license': 'LGPL-3', -} diff --git a/addons/account_payment_invoice_online_payment_patch/i18n/account_payment_extension.pot b/addons/account_payment_invoice_online_payment_patch/i18n/account_payment_extension.pot deleted file mode 100644 index 8c54d548a9a..00000000000 --- a/addons/account_payment_invoice_online_payment_patch/i18n/account_payment_extension.pot +++ /dev/null @@ -1,111 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * account_payment_invoice_online_payment_patch -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 16.0+e\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-26 13:32+0000\n" -"PO-Revision-Date: 2023-01-26 13:32+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: account_payment_invoice_online_payment_patch -#: model_terms:ir.ui.view,arch_db:account_payment_invoice_online_payment_patch.portal_my_invoices_payment -msgid "" -" Cancelled" -msgstr "" - -#. module: account_payment_invoice_online_payment_patch -#: model_terms:ir.ui.view,arch_db:account_payment_invoice_online_payment_patch.portal_my_invoices_payment -msgid "" -" Waiting for Payment" -msgstr "" - -#. module: account_payment_invoice_online_payment_patch -#: model_terms:ir.ui.view,arch_db:account_payment_invoice_online_payment_patch.portal_my_invoices_payment -msgid "" -" Waiting for " -"Payment" -msgstr "" - -#. module: account_payment_invoice_online_payment_patch -#: model_terms:ir.ui.view,arch_db:account_payment_invoice_online_payment_patch.portal_my_invoices_payment -msgid "" -" Authorized" -msgstr "" - -#. module: account_payment_invoice_online_payment_patch -#: model_terms:ir.ui.view,arch_db:account_payment_invoice_online_payment_patch.portal_my_invoices_payment -msgid "" -" Paid" -msgstr "" - -#. module: account_payment_invoice_online_payment_patch -#: model_terms:ir.ui.view,arch_db:account_payment_invoice_online_payment_patch.portal_my_invoices_payment -msgid "" -" Reversed" -msgstr "" - -#. module: account_payment_invoice_online_payment_patch -#: model_terms:ir.ui.view,arch_db:account_payment_invoice_online_payment_patch.portal_my_invoices_payment -msgid "" -" Paid" -msgstr "" - -#. module: account_payment_invoice_online_payment_patch -#: model_terms:ir.ui.view,arch_db:account_payment_invoice_online_payment_patch.portal_my_invoices_payment -msgid "" -" Reversed" -msgstr "" - -#. module: account_payment_invoice_online_payment_patch -#: model_terms:ir.ui.view,arch_db:account_payment_invoice_online_payment_patch.portal_my_invoices_payment -msgid "" -" Cancelled" -msgstr "" - -#. module: account_payment_invoice_online_payment_patch -#: model_terms:ir.ui.view,arch_db:account_payment_invoice_online_payment_patch.portal_my_invoices_payment -msgid "" -" Pending" -msgstr "" - -#. module: account_payment_invoice_online_payment_patch -#: model:ir.model,name:account_payment_invoice_online_payment_patch.model_res_config_settings -msgid "Config Settings" -msgstr "" - -#. module: account_payment_invoice_online_payment_patch -#: model_terms:ir.ui.view,arch_db:account_payment_invoice_online_payment_patch.res_config_settings_view_form -msgid "Invoice Online Payment" -msgstr "" - -#. module: account_payment_invoice_online_payment_patch -#: model:ir.model,name:account_payment_invoice_online_payment_patch.model_account_move -msgid "Journal Entry" -msgstr "" - -#. module: account_payment_invoice_online_payment_patch -#: model:ir.model.fields,field_description:account_payment_invoice_online_payment_patch.field_res_config_settings__pay_invoices_online -msgid "Pay Invoices Online" -msgstr "" diff --git a/addons/account_payment_invoice_online_payment_patch/models/__init__.py b/addons/account_payment_invoice_online_payment_patch/models/__init__.py deleted file mode 100644 index 6eca875fbf9..00000000000 --- a/addons/account_payment_invoice_online_payment_patch/models/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# Part of Odoo. See LICENSE file for full copyright and licensing details. - -from . import account_move diff --git a/addons/account_payment_invoice_online_payment_patch/models/account_move.py b/addons/account_payment_invoice_online_payment_patch/models/account_move.py deleted file mode 100644 index e9759dc3da1..00000000000 --- a/addons/account_payment_invoice_online_payment_patch/models/account_move.py +++ /dev/null @@ -1,16 +0,0 @@ -# Part of Odoo. See LICENSE file for full copyright and licensing details. - -from odoo import models -from odoo.tools import str2bool - - -class AccountMove(models.Model): - _inherit = 'account.move' - - def _has_to_be_paid(self): - enabled_feature = str2bool( - self.env['ir.config_parameter'].sudo().get_param( - 'account_payment.enable_portal_payment' - ) - ) - return enabled_feature and super()._has_to_be_paid() diff --git a/addons/account_payment_invoice_online_payment_patch/views/account_portal_templates.xml b/addons/account_payment_invoice_online_payment_patch/views/account_portal_templates.xml deleted file mode 100644 index 70ea7e48a62..00000000000 --- a/addons/account_payment_invoice_online_payment_patch/views/account_portal_templates.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - diff --git a/addons/account_payment_invoice_online_payment_patch/wizards/__init__.py b/addons/account_payment_invoice_online_payment_patch/wizards/__init__.py deleted file mode 100644 index 9a64ab25d27..00000000000 --- a/addons/account_payment_invoice_online_payment_patch/wizards/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# Part of Odoo. See LICENSE file for full copyright and licensing details. - -from . import res_config_settings