details: https://code.tryton.org/tryton/commit/325c9f9efe90
branch: 6.0
user: Sergi Almacellas Abellana <[email protected]>
date: Sun Jan 18 00:18:32 2026 +0100
description:
Set the invoice date to read-only once the invoice has been validated
or posted
Closes #14480
(grafted from 131cabff89d9e3f130cc29dd800fedc0997d4ac9)
diffstat:
modules/account_invoice/invoice.py | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diffs (15 lines):
diff -r 2a0cfbae7d72 -r 325c9f9efe90 modules/account_invoice/invoice.py
--- a/modules/account_invoice/invoice.py Thu Jan 15 22:11:37 2026 +0100
+++ b/modules/account_invoice/invoice.py Sun Jan 18 00:18:32 2026 +0100
@@ -93,7 +93,10 @@
], "State", readonly=True)
invoice_date = fields.Date('Invoice Date',
states={
- 'readonly': Eval('state').in_(['posted', 'paid', 'cancelled']),
+ 'readonly': Eval('state').in_(
+ If(Eval('type') == 'in',
+ ['validated', 'posted', 'paid'],
+ ['posted', 'paid'])),
'required': Eval('state').in_(
If(Eval('type') == 'in',
['validated', 'posted', 'paid'],