← Back to team overview

openerp-community-reviewer team mailing list archive

[Merge] lp:~credativ/ocb-addons/7.0-rounding-fix-posting-inventory into lp:ocb-addons

 

Jacob Hicks (credativ) has proposed merging lp:~credativ/ocb-addons/7.0-rounding-fix-posting-inventory into lp:ocb-addons.

Requested reviews:
  OpenERP Community Backports Team (ocb)
Related bugs:
  Bug #1184192 in OpenERP Addons: "Unedited products are shown on posted inventory tab"
  https://bugs.launchpad.net/openobject-addons/+bug/1184192

For more details, see:
https://code.launchpad.net/~credativ/ocb-addons/7.0-rounding-fix-posting-inventory/+merge/212196
-- 
https://code.launchpad.net/~credativ/ocb-addons/7.0-rounding-fix-posting-inventory/+merge/212196
Your team OpenERP Community Backports Team is requested to review the proposed merge of lp:~credativ/ocb-addons/7.0-rounding-fix-posting-inventory into lp:ocb-addons.
=== modified file 'stock/stock.py'
--- stock/stock.py	2014-03-14 16:09:38 +0000
+++ stock/stock.py	2014-03-21 16:58:34 +0000
@@ -2892,7 +2892,8 @@
                 pid = line.product_id.id
                 product_context.update(uom=line.product_uom.id, to_date=inv.date, date=inv.date, prodlot_id=line.prod_lot_id.id)
                 amount = location_obj._product_get(cr, uid, line.location_id.id, [pid], product_context)[pid]
-                change = line.product_qty - amount
+                digit_precision = dp.get_precision('Product UoM')(cr)[1]
+                change = round(line.product_qty,digit_precision) - round(amount,digit_precision)
                 lot_id = line.prod_lot_id.id
                 if change:
                     location_id = line.product_id.property_stock_inventory.id


Follow ups