From d7566eef04c6f6fe371e9cb2aa984c8b6f2ea976 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Wed, 14 Aug 2024 12:06:06 +0200 Subject: [PATCH 1/3] [IMP] account_payment_order: make reference_type modifiable on posted invoice The Odoo payment_reference field is modifiable, so the reference type should be modifiable too. --- account_payment_order/models/account_move.py | 1 - account_payment_order/views/account_invoice_view.xml | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/account_payment_order/models/account_move.py b/account_payment_order/models/account_move.py index 9ce61841de6..8602018d003 100644 --- a/account_payment_order/models/account_move.py +++ b/account_payment_order/models/account_move.py @@ -23,7 +23,6 @@ class AccountMove(models.Model): # payment mode or company level reference_type = fields.Selection( selection=[("none", "Free Reference"), ("structured", "Structured Reference")], - readonly=True, states={"draft": [("readonly", False)]}, default="none", ) diff --git a/account_payment_order/views/account_invoice_view.xml b/account_payment_order/views/account_invoice_view.xml index a9ceaf6ea70..57b137c8b90 100644 --- a/account_payment_order/views/account_invoice_view.xml +++ b/account_payment_order/views/account_invoice_view.xml @@ -61,8 +61,7 @@ From 31e0c3eb1bc8e81892f635edabe43300d6edfaf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Wed, 14 Aug 2024 12:07:19 +0200 Subject: [PATCH 2/3] [IMP] account_payment_order: make the reference type visible on vendor bills So we can use structured communications on out payments too. --- account_payment_order/views/account_invoice_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_payment_order/views/account_invoice_view.xml b/account_payment_order/views/account_invoice_view.xml index 57b137c8b90..9fcaaf24006 100644 --- a/account_payment_order/views/account_invoice_view.xml +++ b/account_payment_order/views/account_invoice_view.xml @@ -61,7 +61,7 @@ From ed64a919e3d20a8a4e9e690c8cbca8369863a6ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Wed, 14 Aug 2024 12:37:38 +0200 Subject: [PATCH 3/3] [IMP] account_payment_order: better display name for reference_type field Si it is more obvious that it relates to the payment_reference field --- account_payment_order/models/account_move.py | 1 + 1 file changed, 1 insertion(+) diff --git a/account_payment_order/models/account_move.py b/account_payment_order/models/account_move.py index 8602018d003..0828433eef0 100644 --- a/account_payment_order/models/account_move.py +++ b/account_payment_order/models/account_move.py @@ -25,6 +25,7 @@ class AccountMove(models.Model): selection=[("none", "Free Reference"), ("structured", "Structured Reference")], states={"draft": [("readonly", False)]}, default="none", + string="Payment Reference Type", ) payment_line_count = fields.Integer(compute="_compute_payment_line_count")