changeset 919491128175 in modules/production_work_timesheet:default
details: 
https://hg.tryton.org/modules/production_work_timesheet?cmd=changeset;node=919491128175
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
diffstat:

 work.py |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (18 lines):

diff -r 52037824db79 -r 919491128175 work.py
--- a/work.py   Sun Apr 07 19:50:03 2019 +0200
+++ b/work.py   Tue Apr 23 09:57:12 2019 +0200
@@ -18,12 +18,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')

Reply via email to