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:
1 parent
f84a891925
commit
996ceffb64
1 file changed
+5
-2
+5
-2
@@ -50,8 +50,11 @@ class Invoice(Workflow, ModelSQL, ModelView, TaxableMixin):
|
||||
_depends = ['state']
|
||||
|
||||
company = fields.Many2One(
|
||||
'company.company', "Company", required=True, select=True,
|
||||
states=_states, depends=_depends)
|
||||
'company.company', 'Company', required=True, select=True,
|
||||
states={
|
||||
'readonly': _states['readonly'] | Eval('party', True),
|
||||
},
|
||||
depends=_depends + ['party'])
|
||||
company_party = fields.Function(
|
||||
fields.Many2One(
|
||||
'party.party', "Company Party",
|
||||
|
||||
Reference in new issue
Block a user