Make the party field read-only for saved companies

Closes #14268
This commit is contained in:
Cédric Krier
2025-10-01 10:16:47 +02:00
parent be7347f600
commit 90ded6b681
+5 -2
View File
@@ -47,8 +47,11 @@ _SUBSTITUTION_HELP = (
class Company(ModelSQL, ModelView):
__name__ = 'company.company'
party = fields.Many2One('party.party', 'Party', required=True,
ondelete='CASCADE')
party = fields.Many2One(
'party.party', 'Party', required=True, ondelete='CASCADE',
states={
'readonly': Eval('id', -1) >= 0,
})
header = fields.Text(
'Header',
help="The text to display on report headers.\n" + _SUBSTITUTION_HELP)