From 1b695ec61490a71554b657d7272eea3959207e79 Mon Sep 17 00:00:00 2001 From: Benoit Guillot Date: Thu, 22 Nov 2012 11:30:23 +0100 Subject: [PATCH] [FIX] fix stock move creation when modifying stock --- crm_claim_rma/stock.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crm_claim_rma/stock.py b/crm_claim_rma/stock.py index 73f683fc..2c949190 100644 --- a/crm_claim_rma/stock.py +++ b/crm_claim_rma/stock.py @@ -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 \ No newline at end of file