[FIX] stock: check if the move exists to avoid the key error
bzr revid: nel@tinyerp.com-20120424151904-9i6y2hus5v21asg3
This commit is contained in:
parent
125acaa6e7
commit
200f95d0b2
|
@ -100,7 +100,7 @@ class stock_return_picking(osv.osv_memory):
|
|||
valid_lines = 0
|
||||
return_history = self.get_return_history(cr, uid, record_id, context)
|
||||
for m in pick.move_lines:
|
||||
if m.product_qty * m.product_uom.factor > return_history[m.id]:
|
||||
if return_history.get(m.id) and m.product_qty * m.product_uom.factor > return_history[m.id]:
|
||||
valid_lines += 1
|
||||
if not valid_lines:
|
||||
raise osv.except_osv(_('Warning !'), _("There are no products to return (only lines in Done state and not fully returned yet can be returned)!"))
|
||||
|
|
Loading…
Reference in New Issue