product uom conversion should use ceiling instead of rounding
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Fix Released
|
Medium
|
OpenERP Publisher's Warranty Team |
Bug Description
Warranty #M120914764-
By default, OpenERP 7.0's product uom conversion rounds to specified precision using standard rounding.
This causes a problem in the following scenario:
1) Create a product with UoM single piece, and Purchase UoM 10-pack (bigger than reference, factor = 10, rounding = 1.0)
2) Create a make-to-order Sale Order for 4 of this product.
3) Confirm sale order, and view resulting Purchase Order.
We only want to buy the product in 10-packs, so the PO will be rounded to the nearest whole number of 4/10 = .4 = 0.
Obviously a PO for zero 10-packs will not fulfill the original sale order.
The solution would be as simple as modifying product.uom's _compute_qty_obj() function to use math.ceil() instead of round().
Related branches
- Olivier Dony (Odoo): Approve
-
Diff: 187 lines (+62/-27)8 files modifiedmrp/mrp.py (+4/-1)
product/__openerp__.py (+0/-1)
product/_common.py (+12/-6)
product/pricelist.py (+2/-2)
product/product.py (+2/-2)
product/test/product_uom.yml (+0/-15)
product/tests/__init__.py (+5/-0)
product/tests/test_uom.py (+37/-0)
Changed in openobject-addons: | |
assignee: | nobody → OpenERP Publisher's Warranty Team (openerp-opw) |
tags: | added: maintenance |
Changed in openobject-addons: | |
importance: | Undecided → Medium |
status: | New → Fix Released |
Hello,
We agree with your analysis, we should round up when converting unit of measures.
We have created and merged a fix for this in addons 7.0
revno: 9868 [merge]
revision-id: <email address hidden>