[trunk] [7.0] stock.check_assign ignores decimal precision

Bug #1268594 reported by Holger Brunn (Therp)
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
New
Undecided
Unassigned
OpenERP Community Backports (Addons)
Status tracked in 7.0
7.0
Fix Released
Undecided
Unassigned

Bug Description

To reproduce:

Create a manufactured product with a bom that includes a quantity which can't be represented as a float proper, i.e. 0.033. Create a production order for this product and confirm the production.

Now have a look on the moves created: You'll find a quantity of 0.033000000000000002 which will cause all sorts of trouble afterwards.

Analysis:

In
http://bazaar.launchpad.net/~openerp/openobject-addons/trunk/view/head:/stock/stock.py#L2189
we update the database directly, thereby circumventing the decimal precision adjustments for product_qty and product_uos_qty. I think changing this to
move.write({'location_id': r[1], 'product_qty': r[0], 'product_uos_qty': product_uos_qty})
already fixes the problem.

Related branches

Revision history for this message
Holger Brunn (Therp) (hbrunn) wrote :

To reproduce, you need python2.6 in most cases

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.