Skip to content

Commit

Permalink
[FIX] respect the UoM's precision when filling a physical inventory
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] authored and Stefan Rijnhart committed Jul 2, 2014
1 parent 4ccd9b9 commit 037ee73
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions addons/stock/wizard/stock_fill_inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ def fill_inventory(self, cr, uid, ids, context=None):
if datas.get((prod_id, lot_id)):
qty += datas[(prod_id, lot_id)]['product_qty']

# Floating point sum could introduce tiny rounding errors :
# Use the UoM API for the rounding (same UoM in & out).
qty = uom_obj._compute_qty_obj(cr, uid,
move.product_id.uom_id, qty,
move.product_id.uom_id)
datas[(prod_id, lot_id)] = {'product_id': prod_id, 'location_id': location, 'product_qty': qty, 'product_uom': move.product_id.uom_id.id, 'prod_lot_id': lot_id}

if datas:
Expand Down

0 comments on commit 037ee73

Please sign in to comment.