Make company of statement readonly once there is a line

The content of the lines depends on the company of the statement, so the user
should not change it once he started to fill the lines.
This commit is contained in:
Cédric Krier
2025-01-20 20:01:05 +01:00
parent f66aae4d0b
commit 125d413b69
+4 -1
View File
@@ -71,7 +71,10 @@ class Statement(Workflow, ModelSQL, ModelView):
name = fields.Char('Name', required=True)
company = fields.Many2One(
'company.company', "Company", required=True, states=_states)
'company.company', "Company", required=True,
states={
'readonly': (Eval('state') != 'draft') | Eval('lines', [0]),
})
journal = fields.Many2One(
'account.statement.journal', "Journal", required=True,
domain=[