changeset 434e987f4214 in modules/production_work_timesheet:4.6
details:
https://hg.tryton.org/modules/production_work_timesheet?cmd=changeset;node=434e987f4214
description:
Use domain to force work value on timesheet lines
The target of the One2Many is wrong because it must be a timesheet work
instead of production work.
issue8175
review281401014
(grafted from 919491128175b499265469d8faa046c88799c360)
diffstat:
work.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diffs (18 lines):
diff -r c7b5791e4e83 -r 434e987f4214 work.py
--- a/work.py Mon Oct 30 15:58:57 2017 +0100
+++ b/work.py Tue Apr 23 09:57:12 2019 +0200
@@ -19,12 +19,13 @@
fields.Boolean('Available on timesheets'),
'on_change_with_timesheet_available')
timesheet_lines = fields.Function(
- fields.One2Many('timesheet.line', 'work', 'Timesheet Lines',
+ fields.One2Many('timesheet.line', None, 'Timesheet Lines',
states={
'invisible': ~Eval('timesheet_works'),
},
domain=[
('company', '=', Eval('company', -1)),
+ ('work', 'in', Eval('timesheet_works', [])),
],
depends=['timesheet_works', 'company']),
'get_timesheet_lines', setter='set_timesheet_lines')