Prevent changing the company when party is set

As many fields are set using party which depends on the company context, the
company can not be changed once they are set.

issue10289
review332591002
This commit is contained in:
Cédric Krier committed 2021-04-22 00:03:28 +02:00
1 parent b857ac00ce
commit 2a702680e3
1 file changed
+2 -2
+2 -2
View File
@@ -32,9 +32,9 @@ class Subscription(Workflow, ModelSQL, ModelView):
company = fields.Many2One(
'company.company', "Company", required=True, select=True,
states={
'readonly': Eval('state') != 'draft',
'readonly': (Eval('state') != 'draft') | Eval('party', True),
},
depends=['state'],
depends=['state', 'party'],
help="Make the subscription belong to the company.")
number = fields.Char(