Merge lp:~openerp-dev/openobject-addons/6.0-opw-574268-ado into lp:openobject-addons/6.0

Proposed by Amit Dodiya (OpenERP)
Status: Approved
Approved by: Naresh(OpenERP)
Approved revision: 5216
Proposed branch: lp:~openerp-dev/openobject-addons/6.0-opw-574268-ado
Merge into: lp:openobject-addons/6.0
Diff against target: 12 lines (+2/-1)
1 file modified
purchase/purchase.py (+2/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.0-opw-574268-ado
Reviewer Review Type Date Requested Status
Naresh(OpenERP) (community) Approve
Xavier ALT Pending
Review via email: mp+104205@code.launchpad.net

Description of the change

Hello,

"[FIX] conversion of uom is not correct in purchase order when we have diffrent uom in product and supplier"

Steps:
1). Create a stockable product with Procurement method = "make to order" and Supply method = "buy"
2). Add supplier in above product with Minimal quantity = 1, with supplier uom = tonne and add two pricelist(quantity = 1, unit price = 200 and quantity = 10, unit price = 180)
3). Set product default uom = gm with ratio 125.0000 and Uom Type = Smaller than reference Uom, Purchase uom = tonne
4). Change Default purchase pricelist configuration set based on "Partner section of the product form"
5). Create a sale order, in sale order line add above product with quantity = 125000 in Uom = gm, Confirm the sale order, Run the procurement, Now the purchase order is created but the purchase order line contains the quantity without conversion.

The product quantity in purchase order line should be converted in supplier uom.

Regards,
Amit

To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) :
review: Approve

Unmerged revisions

5216. By Amit Dodiya (OpenERP)

[FIX] conversion of uom is not correct in purchase order when we have diffrent uom in product and supplier

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'purchase/purchase.py'
2--- purchase/purchase.py 2012-03-20 10:37:52 +0000
3+++ purchase/purchase.py 2012-05-01 05:46:21 +0000
4@@ -810,7 +810,8 @@
5
6 qty = uom_obj._compute_qty(cr, uid, procurement.product_uom.id, procurement.product_qty, uom_id)
7 if seller_qty:
8- qty = max(qty,seller_qty)
9+ conv_seller_qty = uom_obj._compute_qty(cr, uid, procurement.product_uom.id, seller_qty, uom_id)
10+ qty = max(qty, conv_seller_qty)
11
12 price = pricelist_obj.price_get(cr, uid, [pricelist_id], procurement.product_id.id, qty, partner_id, {'uom': uom_id})[pricelist_id]
13