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

Proposed by Mohammad Alhashash
Status: Rejected
Rejected by: Holger Brunn (Therp)
Proposed branch: lp:~alhashash/ocb-addons/7.0-bug-1164630-rounding_check_in_partial_picking
Merge into: lp:ocb-addons
Diff against target: 27 lines (+5/-2)
1 file modified
stock/wizard/stock_partial_picking.py (+5/-2)
To merge this branch: bzr merge lp:~alhashash/ocb-addons/7.0-bug-1164630-rounding_check_in_partial_picking
Reviewer Review Type Date Requested Status
Holger Brunn (Therp) Disapprove
Review via email: mp+218387@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Holger Brunn (Therp) (hbrunn) wrote :

Development for 7.0 has moved to github on https://github.com/OCA/ocb - please move your merge proposal there if it is still valid.

(I close and reject this in order to have a cleaner overview for 6.1 MPs which indeed have to be done on launchpad)

review: Disapprove

Unmerged revisions

10168. By Mohammad Alhashash

Fix bug lp:1164630 Picking partial delivery does not properly check rounding

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== 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 @@
167 picking_type = partial.picking_id.type167 picking_type = partial.picking_id.type
168 for wizard_line in partial.move_ids:168 for wizard_line in partial.move_ids:
169 line_uom = wizard_line.product_uom169 line_uom = wizard_line.product_uom
170 move_uom = wizard_line.move_id.product_uom
170 move_id = wizard_line.move_id.id171 move_id = wizard_line.move_id.id
171172
172 #Quantiny must be Positive173 #Quantiny must be Positive
@@ -174,11 +175,13 @@
174 raise osv.except_osv(_('Warning!'), _('Please provide proper Quantity.'))175 raise osv.except_osv(_('Warning!'), _('Please provide proper Quantity.'))
175176
176 #Compute the quantity for respective wizard_line in the line uom (this jsut do the rounding if necessary)177 #Compute the quantity for respective wizard_line in the line uom (this jsut do the rounding if necessary)
177 qty_in_line_uom = uom_obj._compute_qty(cr, uid, line_uom.id, wizard_line.quantity, line_uom.id)178 qty_in_move_uom = uom_obj._compute_qty(cr, uid, line_uom.id, wizard_line.quantity, move_uom.id)
179 qty_in_line_uom = uom_obj._compute_qty(cr, uid, move_uom.id, qty_in_move_uom, line_uom.id)
178180
179 if line_uom.factor and line_uom.factor <> 0:181 if line_uom.factor and line_uom.factor <> 0:
180 if float_compare(qty_in_line_uom, wizard_line.quantity, precision_rounding=line_uom.rounding) != 0:182 if float_compare(qty_in_line_uom, wizard_line.quantity, precision_rounding=line_uom.rounding) != 0:
181 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))183 rounding = uom_obj._compute_qty(cr, uid, move_uom.id, move_uom.rounding, line_uom.id)
184 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))
182 if move_id:185 if move_id:
183 #Check rounding Quantity.ex.186 #Check rounding Quantity.ex.
184 #picking: 1kg, uom kg rounding = 0.01 (rounding to 10g),187 #picking: 1kg, uom kg rounding = 0.01 (rounding to 10g),