details: https://code.tryton.org/tryton/commit/2ccd8423a872
branch: 8.0
user: Cédric Krier <[email protected]>
date: Tue Jun 02 12:00:50 2026 +0200
description:
Prevent modifying the company of project work with parent, children or
timesheet
Closes #14871
(grafted from 8e66491c57a6e2eee0d4c3e88d52a84b72c0a933)
diffstat:
modules/project/work.py | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diffs (16 lines):
diff -r f635398c52ab -r 2ccd8423a872 modules/project/work.py
--- a/modules/project/work.py Thu May 28 16:30:28 2026 +0200
+++ b/modules/project/work.py Tue Jun 02 12:00:50 2026 +0200
@@ -161,7 +161,11 @@
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',