details:   https://code.tryton.org/tryton/commit/7c41cf2f4d34
branch:    7.6
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 2ba2992dc2ec -r 7c41cf2f4d34 modules/account_invoice/invoice.py
--- a/modules/account_invoice/invoice.py        Wed Jan 07 08:29:45 2026 +0100
+++ b/modules/account_invoice/invoice.py        Sun Jan 18 00:18:32 2026 +0100
@@ -132,7 +132,10 @@
             ], "State", readonly=True, sort=False)
     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'],

Reply via email to