diff --git a/work.py b/work.py index 4698397..034b987 100644 --- a/work.py +++ b/work.py @@ -1,5 +1,5 @@ -#The COPYRIGHT file at the top level of this repository contains the full -#copyright notices and license terms. +# The COPYRIGHT file at the top level of this repository contains the full +# copyright notices and license terms. from trytond.model import ModelView, fields from trytond.pool import Pool, PoolMeta from trytond.pyson import Eval @@ -7,7 +7,6 @@ from trytond.transaction import Transaction from trytond.wizard import Wizard, StateView, StateTransition, Button __all__ = ['Work', 'CreateFromTemplateStart', 'CreateFromTemplate'] - __metaclass__ = PoolMeta @@ -50,6 +49,9 @@ class Work: with transaction.set_context(template=True): cls.write(to_update, {'template': values['template']}) + del values['template'] + if values: + args.extend((works, values)) else: args.extend((works, values)) return super(Work, cls).write(*args)