Don't copy timesheet and project children as link between both will be lost

review1042002
This commit is contained in:
Cédric Krier committed 2013-09-02 11:03:48 +02:00
1 parent 8099f8b140
commit 8661b1e5d3
1 file changed
+2
+2
View File
@@ -315,11 +315,13 @@ class Work(ModelSQL, ModelView):
for key in timesheet_default.keys():
if key in cls._fields:
del timesheet_default[key]
timesheet_default['children'] = None
new_project_works = []
for project_work in project_works:
timesheet_work, = TimesheetWork.copy([project_work.work],
default=timesheet_default)
pwdefault = default.copy()
pwdefault['children'] = None
pwdefault['work'] = timesheet_work.id
new_project_works.extend(super(Work, cls).copy([project_work],
default=pwdefault))