details: https://code.tryton.org/tryton/commit/907409b6d3da
branch: 6.0
user: Cédric Krier <[email protected]>
date: Sat Apr 04 00:52:12 2026 +0200
description:
Make the payment term fields readonly for non draft amendment lines
Closes #14746
(grafted from 85902c3ab347d29e9b4e957828add75f2cb2beef)
diffstat:
modules/purchase_amendment/purchase.py | 1 +
modules/sale_amendment/sale.py | 1 +
2 files changed, 2 insertions(+), 0 deletions(-)
diffs (22 lines):
diff -r 581b26bb8b8c -r 907409b6d3da modules/purchase_amendment/purchase.py
--- a/modules/purchase_amendment/purchase.py Thu Apr 02 17:57:49 2026 +0200
+++ b/modules/purchase_amendment/purchase.py Sat Apr 04 00:52:12 2026 +0200
@@ -195,6 +195,7 @@
payment_term = fields.Many2One(
'account.invoice.payment_term', "Payment Term",
states={
+ 'readonly': Eval('state') != 'draft',
'invisible': Eval('action') != 'payment_term',
},
depends=['action'])
diff -r 581b26bb8b8c -r 907409b6d3da modules/sale_amendment/sale.py
--- a/modules/sale_amendment/sale.py Thu Apr 02 17:57:49 2026 +0200
+++ b/modules/sale_amendment/sale.py Sat Apr 04 00:52:12 2026 +0200
@@ -211,6 +211,7 @@
payment_term = fields.Many2One(
'account.invoice.payment_term', "Payment Term",
states={
+ 'readonly': Eval('state') != 'draft',
'invisible': Eval('action') != 'payment_term',
},
depends=['action'])