Use setdefault to allow a copy with one of this field with a value

bzr revid: guewen.baconnier@camptocamp.com-20140224090354-wcsnd4wzs91w553e
This commit is contained in:
Guewen Baconnier 2014-02-24 10:03:54 +01:00
parent 1daeaed376
commit 0ff86218f6
1 changed files with 4 additions and 6 deletions

View File

@ -1806,12 +1806,10 @@ class stock_move(osv.osv):
if default is None:
default = {}
default = default.copy()
default.update({
'tracking_id': False,
'prodlot_id': False,
'move_history_ids2': [],
'move_history_ids': []
})
default.setdefault('tracking_id', False)
default.setdefault('prodlot_id', False)
default.setdefault('move_history_ids', [])
default.setdefault('move_history_ids2', [])
return super(stock_move, self).copy_data(cr, uid, id, default, context=context)
def _auto_init(self, cursor, context=None):