Set the invoice date to read-only once the invoice has been validated or posted

Closes #14480
(grafted from 131cabff89d9e3f130cc29dd800fedc0997d4ac9)

--HG--
branch : 6.0
This commit is contained in:
Sergi Almacellas Abellana committed 2026-01-18 00:18:32 +01:00
1 parent 12897650fc
commit aec3bd0237
1 file changed
+4 -1
+4 -1
View File
@@ -93,7 +93,10 @@ class Invoice(Workflow, ModelSQL, ModelView, TaxableMixin):
], "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'],