changeset dc5037f9beee in modules/project:default
details: https://hg.tryton.org/modules/project?cmd=changeset&node=dc5037f9beee
description:
Send only the required fields when fetching a readonly view definition
issue11134
review380081002
diffstat:
work.py | 19 +++++++------------
1 files changed, 7 insertions(+), 12 deletions(-)
diffs (57 lines):
diff -r 8d65d420aa67 -r dc5037f9beee work.py
--- a/work.py Wed Apr 06 23:37:43 2022 +0200
+++ b/work.py Fri Apr 08 19:07:13 2022 +0200
@@ -136,12 +136,12 @@
context={
'company': Eval('company', -1),
},
- depends=['type', 'company'])
+ depends={'company'})
party_address = fields.Many2One('party.address', 'Contact Address',
domain=[('party', '=', Eval('party'))],
states={
'invisible': Eval('type') != 'project',
- }, depends=['party', 'type'])
+ })
timesheet_works = fields.One2Many(
'timesheet.work', 'origin', 'Timesheet Works', readonly=True, size=1)
timesheet_available = fields.Function(
@@ -150,14 +150,12 @@
timesheet_start_date = fields.Function(fields.Date('Timesheet Start',
states={
'invisible': ~Eval('timesheet_available'),
- },
- depends=['timesheet_available']),
+ }),
'get_timesheet_date', setter='set_timesheet_date')
timesheet_end_date = fields.Function(fields.Date('Timesheet End',
states={
'invisible': ~Eval('timesheet_available'),
- },
- depends=['timesheet_available']),
+ }),
'get_timesheet_date', setter='set_timesheet_date')
timesheet_duration = fields.Function(fields.TimeDelta('Duration',
'company_work_time',
@@ -191,18 +189,15 @@
'project.work', 'Parent', path='path', ondelete='RESTRICT',
domain=[
('company', '=', Eval('company', -1)),
- ],
- depends=['company'])
+ ])
path = fields.Char("Path", select=True)
children = fields.One2Many('project.work', 'parent', 'Children',
domain=[
('company', '=', Eval('company', -1)),
- ],
- depends=['company'])
+ ])
status = fields.Many2One(
'project.work.status', "Status", required=True, select=True,
- domain=[If(Bool(Eval('type')), ('types', 'in', Eval('type')), ())],
- depends=['type'])
+ domain=[If(Bool(Eval('type')), ('types', 'in', Eval('type')), ())])
@staticmethod
def default_type():