Prevent changing company of invoice with lines filled

Closes #12620
This commit is contained in:
Cédric Krier
2023-10-07 08:47:30 +02:00
parent b356dc2276
commit b037f93b77
+4 -1
View File
@@ -69,7 +69,10 @@ class Invoice(Workflow, ModelSQL, ModelView, TaxableMixin, InvoiceReportMixin):
company = fields.Many2One(
'company.company', "Company", required=True,
states={
'readonly': _states['readonly'] | Eval('party', True),
'readonly': (
_states['readonly']
| Eval('party', True)
| Eval('lines', [0])),
})
company_party = fields.Function(
fields.Many2One(