From 2b83cdfff6cad28301e0956286b178e56792b165 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Wed, 27 Apr 2011 16:48:22 +0530 Subject: [PATCH] [ADD]stock:stock_partial_picking.py ADD comments for increase readability of code bzr revid: ron@tinyerp.com-20110427111822-ow49y4b5l99yeh07 --- addons/stock/wizard/stock_partial_move_view.xml | 7 ++++++- addons/stock/wizard/stock_partial_picking.py | 8 ++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/addons/stock/wizard/stock_partial_move_view.xml b/addons/stock/wizard/stock_partial_move_view.xml index 02dd63fe5dd..6121e0bab5a 100644 --- a/addons/stock/wizard/stock_partial_move_view.xml +++ b/addons/stock/wizard/stock_partial_move_view.xml @@ -20,7 +20,6 @@ - stock.move.memory.tree stock.move.memory.in @@ -30,6 +29,9 @@ + @@ -64,6 +66,9 @@ + diff --git a/addons/stock/wizard/stock_partial_picking.py b/addons/stock/wizard/stock_partial_picking.py index a69686eff28..f1a5ad29dcd 100644 --- a/addons/stock/wizard/stock_partial_picking.py +++ b/addons/stock/wizard/stock_partial_picking.py @@ -156,14 +156,22 @@ class stock_partial_picking(osv.osv_memory): for move in moves_list: move_uom = move.move_id.product_uom process_uom = move.product_uom + #Quantiny must be Positive if move.quantity <= 0: raise osv.except_osv(_('Warning!'), _('Please provide Proper Quantity !')) + + #category id must be same for respective move if move_uom.category_id.id != process_uom.category_id.id: raise osv.except_osv(_('Warning'), _('You can not process %s %s as it\'s category is different than category of %s of this move!') % (move.quantity, process_uom.name, move_uom.name)) + + #Pikcing move product UOM factor must be bigger with respective wizard move product uom factor if move_uom.factor < process_uom.factor: raise osv.except_osv(_('Warning'), _('You can not process in UOM "%s" which is smaller than UOM "%s" of the current move.') % (process_uom.name, move_uom.name)) + #Compute the wizard Quantity for respective move. toprocess = uom_obj._compute_qty(cr, uid, move.product_uom.id, move.quantity, move.move_id.product_uom.id) + + #Compare wizard Quantity with respective picking move quantity if wizard move quantity bigger then it's giving warning. if toprocess > move.move_id.product_qty: raise osv.except_osv(_('Warning'), _('You can not process "%s %s" as the qty is more than "%s %s" of respective move.') % (move.quantity, process_uom.name, move.move_id.product_qty, move_uom.name)) partial_datas['move%s' % (move.move_id.id)] = {