From 10c8c4cf196afd95103b49811a3d6b7dffa606ff Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Fri, 6 May 2011 11:33:58 +0530 Subject: [PATCH 1/2] [FIX]stock:entering a negative value in the stock level when click on update button on product form lp bug: https://launchpad.net/bugs/777803 fixed bzr revid: ron@tinyerp.com-20110506060358-audc98nfxyt6b116 --- addons/stock/wizard/stock_change_product_qty.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/stock/wizard/stock_change_product_qty.py b/addons/stock/wizard/stock_change_product_qty.py index f9ae8e2b642..6d0d2a32862 100644 --- a/addons/stock/wizard/stock_change_product_qty.py +++ b/addons/stock/wizard/stock_change_product_qty.py @@ -85,6 +85,8 @@ class stock_change_product_qty(osv.osv_memory): res_original = prod_obj_pool.browse(cr, uid, rec_id, context=context) for data in self.browse(cr, uid, ids, context=context): + if data.new_quantity <= 0: + raise osv.except_osv(_('Warning!'), _('Please provide Proper Quantity !')) inventory_id = inventry_obj.create(cr , uid, {'name': _('INV: %s') % tools.ustr(res_original.name)}, context=context) line_data ={ 'inventory_id' : inventory_id, From 0e9d77f5285396081701ec8802e9121ebf2e66fd Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Fri, 6 May 2011 12:22:08 +0530 Subject: [PATCH 2/2] [IMP]stock:entering a negative value give the warning bzr revid: ron@tinyerp.com-20110506065208-vdkuowmwy4iv1fxn --- addons/stock/wizard/stock_change_product_qty.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/wizard/stock_change_product_qty.py b/addons/stock/wizard/stock_change_product_qty.py index 6d0d2a32862..4f3146628cb 100644 --- a/addons/stock/wizard/stock_change_product_qty.py +++ b/addons/stock/wizard/stock_change_product_qty.py @@ -86,7 +86,7 @@ class stock_change_product_qty(osv.osv_memory): res_original = prod_obj_pool.browse(cr, uid, rec_id, context=context) for data in self.browse(cr, uid, ids, context=context): if data.new_quantity <= 0: - raise osv.except_osv(_('Warning!'), _('Please provide Proper Quantity !')) + raise osv.except_osv(_('Warning!'), _('Quantity cannot be negative or zero.')) inventory_id = inventry_obj.create(cr , uid, {'name': _('INV: %s') % tools.ustr(res_original.name)}, context=context) line_data ={ 'inventory_id' : inventory_id,