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:
Cédric Krier
2026-06-02 12:00:50 +02:00
parent b17a80a045
commit 012398d060
+5 -1
View File
@@ -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',