[FIX] fix stock move creation when modifying stock

This commit is contained in:
Benoit Guillot
2012-11-22 11:30:23 +01:00
parent 0a7400c529
commit 1b695ec614

View File

@@ -54,7 +54,8 @@ class stock_move(osv.osv):
def create(self, cr, uid, vals, context=None):
move_id = super(stock_move, self).create(cr, uid, vals, context=context)
picking = self.pool.get('stock.picking').browse(cr, uid, vals['picking_id'], context=context)
if picking.claim_picking and picking.type == u'in':
move = self.write(cr, uid, move_id, {'state': 'confirmed'}, context=context)
if vals.get('picking_id'):
picking = self.pool.get('stock.picking').browse(cr, uid, vals['picking_id'], context=context)
if picking.claim_picking and picking.type == u'in':
move = self.write(cr, uid, move_id, {'state': 'confirmed'}, context=context)
return move_id