← Back to team overview

openerp-community-reviewer team mailing list archive

[Bug 1268594] Re: [trunk] [7.0] stock.check_assign ignores decimal precision

 

** Also affects: ocb-addons/7.0
   Importance: Undecided
       Status: New

-- 
You received this bug notification because you are a member of OpenERP
Community Backports Team, which is subscribed to OpenERP Community
Backports (Addons).
https://bugs.launchpad.net/bugs/1268594

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

Status in OpenERP Community Backports (Addons):
  New
Status in OpenERP Community Backports (Addons) 7.0 series:
  New
Status in OpenERP Addons (modules):
  New

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ocb-addons/+bug/1268594/+subscriptions