← Back to team overview

openerp-community-reviewer team mailing list archive

[Merge] lp:~alhashash/ocb-addons/7.0-bug-1164630-rounding_check_in_partial_picking into lp:ocb-addons

 

Mohammad Alhashash has proposed merging lp:~alhashash/ocb-addons/7.0-bug-1164630-rounding_check_in_partial_picking into lp:ocb-addons.

Requested reviews:
  OpenERP Community Backports (ocb)

For more details, see:
https://code.launchpad.net/~alhashash/ocb-addons/7.0-bug-1164630-rounding_check_in_partial_picking/+merge/218387
-- 
https://code.launchpad.net/~alhashash/ocb-addons/7.0-bug-1164630-rounding_check_in_partial_picking/+merge/218387
Your team OpenERP Community Backports is requested to review the proposed merge of lp:~alhashash/ocb-addons/7.0-bug-1164630-rounding_check_in_partial_picking into lp:ocb-addons.
=== modified file 'stock/wizard/stock_partial_picking.py'
--- stock/wizard/stock_partial_picking.py	2014-03-10 08:54:20 +0000
+++ stock/wizard/stock_partial_picking.py	2014-05-06 11:12:32 +0000
@@ -167,6 +167,7 @@
         picking_type = partial.picking_id.type
         for wizard_line in partial.move_ids:
             line_uom = wizard_line.product_uom
+            move_uom = wizard_line.move_id.product_uom
             move_id = wizard_line.move_id.id
 
             #Quantiny must be Positive
@@ -174,11 +175,13 @@
                 raise osv.except_osv(_('Warning!'), _('Please provide proper Quantity.'))
 
             #Compute the quantity for respective wizard_line in the line uom (this jsut do the rounding if necessary)
-            qty_in_line_uom = uom_obj._compute_qty(cr, uid, line_uom.id, wizard_line.quantity, line_uom.id)
+            qty_in_move_uom = uom_obj._compute_qty(cr, uid, line_uom.id, wizard_line.quantity, move_uom.id)
+            qty_in_line_uom = uom_obj._compute_qty(cr, uid, move_uom.id, qty_in_move_uom, line_uom.id)
 
             if line_uom.factor and line_uom.factor <> 0:
                 if float_compare(qty_in_line_uom, wizard_line.quantity, precision_rounding=line_uom.rounding) != 0:
-                    raise osv.except_osv(_('Warning!'), _('The unit of measure rounding does not allow you to ship "%s %s", only rounding of "%s %s" is accepted by the Unit of Measure.') % (wizard_line.quantity, line_uom.name, line_uom.rounding, line_uom.name))
+                    rounding = uom_obj._compute_qty(cr, uid, move_uom.id, move_uom.rounding, line_uom.id)
+                    raise osv.except_osv(_('Warning!'), _('The unit of measure rounding does not allow you to ship "%s %s", only rounding of "%s %s" is accepted by the Unit of Measure.') % (wizard_line.quantity, line_uom.name, rounding, line_uom.name))
             if move_id:
                 #Check rounding Quantity.ex.
                 #picking: 1kg, uom kg rounding = 0.01 (rounding to 10g),


Follow ups