details: https://code.tryton.org/tryton/commit/85902c3ab347
branch: default
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
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 4d0f9b9009fb -r 85902c3ab347 modules/purchase_amendment/purchase.py
--- a/modules/purchase_amendment/purchase.py Thu Apr 02 23:47:00 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", ondelete='RESTRICT',
states={
+ 'readonly': Eval('state') != 'draft',
'invisible': Eval('action') != 'payment_term',
})
diff -r 4d0f9b9009fb -r 85902c3ab347 modules/sale_amendment/sale.py
--- a/modules/sale_amendment/sale.py Thu Apr 02 23:47:00 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", ondelete='RESTRICT',
states={
+ 'readonly': Eval('state') != 'draft',
'invisible': Eval('action') != 'payment_term',
})