Prevent modifying the company of project work with parent, children or timesheet
Closes #14871 (grafted from 8e66491c57a6e2eee0d4c3e88d52a84b72c0a933) --HG-- branch : 8.0
This commit is contained in:
@@ -161,7 +161,11 @@ class Work(
|
||||
company = fields.Many2One(
|
||||
'company.company', "Company", required=True,
|
||||
states={
|
||||
'readonly': Bool(Eval('origin', None)),
|
||||
'readonly': (
|
||||
Eval('origin', None)
|
||||
| Eval('parent', None)
|
||||
| Eval('children', [])
|
||||
| Eval('timesheet_duration', 0)),
|
||||
})
|
||||
number = fields.Char("Number", readonly=True)
|
||||
party = fields.Many2One('party.party', 'Party',
|
||||
|
||||
Reference in New Issue
Block a user