← Back to team overview

openerp-india team mailing list archive

[Bug 985619] Re: mrp.production consume&produce gives moves with quantity 0

 

Here is an example:
1. Create a BOM with product qty: 500 kg
2. Add a component with qty: 0.1 kg
3. Create a manufacturing order for that product with that BOM
4. Write that you will produce 13961.777 kg
5. Computing will calculate that you need to consume 2.792 kg
6. When you confirm and try to produce 13961.777kg you will always have 0.000kg remaining to produce which you cannot solve

This is because action_consume in stock.move calculates that quantity_rest is 4.440892098500626e-16
This is very annoying and should be corrected with rounding to product_uom/product_uos which is defined in decimal accuracy!

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/985619

Title:
  mrp.production consume&produce gives moves with quantity 0

Status in OpenERP Addons (modules):
  New

Bug description:
  Hi,

  In a mrp.production, when you produce&consume, in some cases, the
  stock.moves in the consumed products will have a quantity of 0.

  It seems to come from a rounding error (eg. a textual representation
  of 9 could be 8.9839847893 in memory).

  In openobject-addons/stock/stock.py in action_consume :

  quantity_rest -= quantity

  should be :

  quantity_rest = round(quantity_rest - quantity, 3)

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


References