[IMP]stock : improve code which is more batter for return picking

bzr revid: mma@tinyerp.com-20120910104422-1s9h1fq25ud2iwvs
This commit is contained in:
Mayur Maheshwari (OpenERP)
2012-09-10 16:14:22 +05:30
parent 02c2952592
commit 0a9c1b54ca
+1 -2
View File
@@ -100,8 +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 return_history and return_history.get(m.id):
if m.product_qty * m.product_uom.factor > return_history[m.id]:
if (return_history.get(m.id) is not None) and (m.product_qty * m.product_uom.factor > return_history[m.id]):
valid_lines += 1
if not valid_lines:
raise osv.except_osv(_('Warning!'), _("No products to return (only lines in Done state and not fully returned yet can be returned)!"))