[FIX]: Fixed problem of zero division in action_consume of move

bzr revid: rpa@tinyerp.com-20101221071653-ksfh0unorhuuk3e7
This commit is contained in:
rpa (Open ERP) 2010-12-21 12:46:53 +05:30
parent 977020567b
commit 394cfd398f
1 changed files with 2 additions and 0 deletions

View File

@ -2272,6 +2272,8 @@ class stock_move(osv.osv):
res = []
for move in self.browse(cr, uid, ids, context=context):
move_qty = move.product_qty
if move_qty <= 0:
raise osv.except_osv(_('Error!'), _('Can not consume a move with negative or zero quantity !'))
quantity_rest = move.product_qty
quantity_rest -= quantity