changeset 8715080e5f2e in modules/production_work:5.2
details:
https://hg.tryton.org/modules/production_work?cmd=changeset;node=8715080e5f2e
description:
Clear works when copying productions
issue8887
review272591002
(grafted from dfa96fcc9f160f3c8179e7496b8514e5719635b0)
diffstat:
production.py | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diffs (16 lines):
diff -r 9439fb73e77e -r 8715080e5f2e production.py
--- a/production.py Fri Nov 08 19:41:05 2019 +0100
+++ b/production.py Tue Dec 03 18:42:46 2019 +0100
@@ -132,3 +132,12 @@
production=production.rec_name,
work=work.rec_name))
super(Production, cls).done(productions)
+
+ @classmethod
+ def copy(cls, productions, default=None):
+ if default is None:
+ default = {}
+ else:
+ default = default.copy()
+ default.setdefault('works')
+ return super().copy(productions, default=default)