Don't lost other modifications when template field is modified
This commit is contained in:
parent
7d78b5e599
commit
950a059025
8
work.py
8
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)
|
||||
|
|
Loading…
Reference in New Issue