diff --git a/account_payment_order/README.rst b/account_payment_order/README.rst index fe9f25a97..1a309adc9 100644 --- a/account_payment_order/README.rst +++ b/account_payment_order/README.rst @@ -7,7 +7,7 @@ Account Payment Order !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:7770aeb8f31eacf1b549225db47abcb160f8c5324d0a12eb9e828a6e843b0b45 + !! source digest: sha256:4fd043df58062557f068abf08f254c3a17a70a13d803604022782b977cd8c337 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png diff --git a/account_payment_order/__manifest__.py b/account_payment_order/__manifest__.py index c507a709b..f76c9695d 100644 --- a/account_payment_order/__manifest__.py +++ b/account_payment_order/__manifest__.py @@ -26,6 +26,7 @@ "security/ir.model.access.csv", "wizard/account_payment_line_create_view.xml", "wizard/account_invoice_payment_line_multi_view.xml", + "wizard/account_payment_update_views.xml", "views/account_payment_mode.xml", "views/account_payment_views.xml", "views/account_payment_order.xml", diff --git a/account_payment_order/models/account_payment.py b/account_payment_order/models/account_payment.py index 45075eb2d..84d8b212e 100644 --- a/account_payment_order/models/account_payment.py +++ b/account_payment_order/models/account_payment.py @@ -1,8 +1,9 @@ # Copyright 2019 ACSONE SA/NV # Copyright 2022 Tecnativa - Pedro M. Baeza +# Copyright 2023 Noviat # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import api, fields, models +from odoo import _, api, fields, models class AccountPayment(models.Model): @@ -10,6 +11,9 @@ class AccountPayment(models.Model): payment_order_id = fields.Many2one(comodel_name="account.payment.order") payment_line_ids = fields.Many2many(comodel_name="account.payment.line") + order_state = fields.Selection( + related="payment_order_id.state", string="Payment Order State" + ) @api.depends("payment_type", "journal_id") def _compute_payment_method_line_fields(self): @@ -48,3 +52,18 @@ class AccountPayment(models.Model): else: super(AccountPayment, pay)._check_payment_method_line_id() return + + def update_payment_reference(self): + view = self.env.ref("account_payment_order.account_payment_update_view_form") + return { + "name": _("Update Payment Reference"), + "view_type": "form", + "view_mode": "form", + "res_model": "account.payment.update", + "view_id": view.id, + "target": "new", + "type": "ir.actions.act_window", + "context": dict( + self.env.context, default_payment_reference=self.payment_reference + ), + } diff --git a/account_payment_order/security/ir.model.access.csv b/account_payment_order/security/ir.model.access.csv index d23d69ab9..2a50d1170 100644 --- a/account_payment_order/security/ir.model.access.csv +++ b/account_payment_order/security/ir.model.access.csv @@ -6,3 +6,4 @@ base.access_res_partner_bank_group_partner_manager,Full access on res.partner.ba base.access_res_bank_group_partner_manager,Full access on res.bank to Account Payment group,base.model_res_bank,group_account_payment,1,1,1,1 access_account_payment_line_create,access_account_payment_line_create,model_account_payment_line_create,group_account_payment,1,1,1,1 access_account_invoice_payment_line_multi,access_account_invoice_payment_line_multi,model_account_invoice_payment_line_multi,group_account_payment,1,1,1,1 +access_account_payment_update,access_account_payment_update,model_account_payment_update,group_account_payment,1,1,1,1 diff --git a/account_payment_order/static/description/index.html b/account_payment_order/static/description/index.html index 6ecf21f28..6c48b76c1 100644 --- a/account_payment_order/static/description/index.html +++ b/account_payment_order/static/description/index.html @@ -1,3 +1,4 @@ +
@@ -366,7 +367,7 @@ ul.auto-toc { !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:7770aeb8f31eacf1b549225db47abcb160f8c5324d0a12eb9e828a6e843b0b45 +!! source digest: sha256:4fd043df58062557f068abf08f254c3a17a70a13d803604022782b977cd8c337 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->This module adds support for payment orders and debit orders.
diff --git a/account_payment_order/views/account_payment_views.xml b/account_payment_order/views/account_payment_views.xml index 8dd2d67c1..0e338d2a8 100644 --- a/account_payment_order/views/account_payment_views.xml +++ b/account_payment_order/views/account_payment_views.xml @@ -8,6 +8,14 @@