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
1=== modified file 'stock/wizard/stock_partial_picking.py'
2--- stock/wizard/stock_partial_picking.py 2014-03-10 08:54:20 +0000
3+++ stock/wizard/stock_partial_picking.py 2014-05-06 11:12:32 +0000
4@@ -167,6 +167,7 @@
5 picking_type = partial.picking_id.type
6 for wizard_line in partial.move_ids:
7 line_uom = wizard_line.product_uom
8+ move_uom = wizard_line.move_id.product_uom
9 move_id = wizard_line.move_id.id
10
11 #Quantiny must be Positive
12@@ -174,11 +175,13 @@
13 raise osv.except_osv(_('Warning!'), _('Please provide proper Quantity.'))
14
15 #Compute the quantity for respective wizard_line in the line uom (this jsut do the rounding if necessary)
16- qty_in_line_uom = uom_obj._compute_qty(cr, uid, line_uom.id, wizard_line.quantity, line_uom.id)
17+ qty_in_move_uom = uom_obj._compute_qty(cr, uid, line_uom.id, wizard_line.quantity, move_uom.id)
18+ qty_in_line_uom = uom_obj._compute_qty(cr, uid, move_uom.id, qty_in_move_uom, line_uom.id)
19
20 if line_uom.factor and line_uom.factor <> 0:
21 if float_compare(qty_in_line_uom, wizard_line.quantity, precision_rounding=line_uom.rounding) != 0:
22- 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))
23+ rounding = uom_obj._compute_qty(cr, uid, move_uom.id, move_uom.rounding, line_uom.id)
24+ 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))
25 if move_id:
26 #Check rounding Quantity.ex.
27 #picking: 1kg, uom kg rounding = 0.01 (rounding to 10g),