[FIX] stock : Traceback when click on Return Shipment Wizard.

bzr revid: mdi@tinyerp.com-20120927083535-f5trwbj0o7hlvbxf
This commit is contained in:
Divyesh Makwana (Open ERP) 2012-09-27 14:05:35 +05:30
parent 677a60cdf4
commit e9fd752b34
1 changed files with 2 additions and 2 deletions

View File

@ -100,8 +100,8 @@ 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.get(m.id, 0):
valid_lines += 1
if m.state == 'done' and m.product_qty * m.product_uom.factor > return_history.get(m.id, 0):
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)!"))
return res