From e87e5f2c9f0600b7090f8d2106c5891ef1f34ea3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 6 Jul 2011 17:51:36 +0200 Subject: [PATCH] Don't copy timesheet lines when copying work review55001 --- work.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/work.py b/work.py index 1e2c833789..d321a2a9f2 100644 --- a/work.py +++ b/work.py @@ -30,6 +30,14 @@ class TimesheetWork(ModelSQL, ModelView): self.parent.context['type'] = Eval('type') self._reset_columns() + def copy(self, ids, default=None): + if default is None: + default = {} + default = default.copy() + if 'timesheet_lines' not in default: + default['timesheet_lines'] = False + return super(TimesheetWork, self).copy(ids, default=default) + TimesheetWork()