Merge lp:~openerp-dev/openobject-addons/6.1-opw-579042-rgo into lp:openobject-addons/6.1

Proposed by Ravi Gohil (OpenERP)
Status: Approved
Approved by: Naresh(OpenERP)
Approved revision: 6987
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-579042-rgo
Merge into: lp:openobject-addons/6.1
Diff against target: 23 lines (+6/-2)
1 file modified
mrp_subproduct/mrp_subproduct.py (+6/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-579042-rgo
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Pending
Review via email: mp+123737@code.launchpad.net

Description of the change

Hello,

Currently, the conversion from subproduct's UoM(defined in product's BOM menu, under `Sub Products` tab) to the UoM defined in manufacturing order isn't taking place. It is taking same quantity as in MO.

Please have a look at the detailed steps provided in bug report lp:1047680 for better understanding of the issue and to reproduce the issue.

This fix will solve this issue, kindly review the fix.

Thanks.

To post a comment you must log in.
6986. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

6987. By Ravi Gohil (OpenERP)

[FIX] mrp_subproduct: Fixed the UoM conversion issue between subproduct defined in BOM and UoM defined in manufacturing order : (Maintenance Case : 579042)

Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello,

This bug was qualified as Confirmed on Trunk (means still existing and reproducible). A Merge Proposal for trunk was created to fix it. Here is the link to follow the MP on Launchpad https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-opw-579042-port-mma/+merge/135879 and be informed once it's been merged in trunk: ... If this Merge Proposal could not be merged in v6.1 at the release of v7.0, it will be closed.

Thanks,
Naresh Soni

Unmerged revisions

6987. By Ravi Gohil (OpenERP)

[FIX] mrp_subproduct: Fixed the UoM conversion issue between subproduct defined in BOM and UoM defined in manufacturing order : (Maintenance Case : 579042)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'mrp_subproduct/mrp_subproduct.py'
2--- mrp_subproduct/mrp_subproduct.py 2012-02-14 15:57:46 +0000
3+++ mrp_subproduct/mrp_subproduct.py 2012-09-12 06:54:18 +0000
4@@ -79,13 +79,17 @@
5 if not production.bom_id:
6 continue
7 for sub_product in production.bom_id.sub_products:
8+ product_uom_factor = self.pool.get('product.uom')._compute_qty(cr, uid, production.product_uom.id, production.product_qty, production.bom_id.product_uom.id)
9 qty1 = sub_product.product_qty
10 qty2 = production.product_uos and production.product_uos_qty or False
11+ product_uos_factor = 0.0
12+ if qty2 and production.bom_id.product_uos.id:
13+ product_uos_factor = self.pool.get('product.uom')._compute_qty(cr, uid, production.product_uos.id, production.product_uos_qty, production.bom_id.product_uos.id)
14 if sub_product.subproduct_type == 'variable':
15 if production.product_qty:
16- qty1 *= production.product_qty / (production.bom_id.product_qty or 1.0)
17+ qty1 *= product_uom_factor / (production.bom_id.product_qty or 1.0)
18 if production.product_uos_qty:
19- qty2 *= production.product_uos_qty / (production.bom_id.product_uos_qty or 1.0)
20+ qty2 *= product_uos_factor / (production.bom_id.product_uos_qty or 1.0)
21 data = {
22 'name': 'PROD:'+production.name,
23 'date': production.date_planned,