[IMP] stock: Splitinto wizard raise an error if Total quantity after split exceeds the quantity to split

bzr revid: sbh@tinyerp.com-20100831052840-7fl0i5cv3tpe8tlq
This commit is contained in:
sbh (Open ERP)
2010-08-31 10:58:40 +05:30
parent 566e2d3de7
commit fd690b715a
+4
View File
@@ -41,6 +41,10 @@ class stock_split_into(osv.osv_memory):
quantity = self.browse(cr, uid, data[0], context).quantity or 0.0
for move in move_obj.browse(cr, uid, rec_id):
quantity_rest = move.product_qty - quantity
if quantity > move.product_qty:
raise osv.except_osv(_('Error!'), _('Total quantity after split exceeds the quantity to split ' \
'for this product: "%s" (id: %d)') % \
(move.product_id.name, move.product_id.id,))
if quantity > 0:
move_obj.setlast_tracking(cr, uid, [move.id], context=context)
move_obj.write(cr, uid, [move.id], {