Merge lp:~yann-papouin/ocb-addons/6.1-bug-1048547-product-variant-supplierinfo-pricelist into lp:ocb-addons/6.1

Proposed by Yann Papouin
Status: Merged
Approved by: Holger Brunn (Therp)
Approved revision: no longer in the source branch.
Merged at revision: 6833
Proposed branch: lp:~yann-papouin/ocb-addons/6.1-bug-1048547-product-variant-supplierinfo-pricelist
Merge into: lp:ocb-addons/6.1
Diff against target: 25 lines (+2/-2)
2 files modified
product/pricelist.py (+1/-1)
purchase/purchase.py (+1/-1)
To merge this branch: bzr merge lp:~yann-papouin/ocb-addons/6.1-bug-1048547-product-variant-supplierinfo-pricelist
Reviewer Review Type Date Requested Status
Holger Brunn (Therp) code review Approve
Stefan Rijnhart (Opener) Approve
Pedro Manuel Baeza code review Approve
Review via email: mp+205161@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

I have never faced this problem, but I don't use variants. Seems OK.

Regards.

review: Approve (code review)
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Yes, I have run into problems because I assumed supplierinfo's product_id field refers to product_product while it actually refers to product_template. So the solution seems correct to me.

I checked 7.0 and the change in product/pricelist.py is there, while purchase/purchase.py's onchange_product_id() has been rewritten so that it evades the problem which is fixed in this change.

review: Approve
Revision history for this message
Holger Brunn (Therp) (hbrunn) :
review: Approve (code review)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'product/pricelist.py'
2--- product/pricelist.py 2013-11-20 01:17:39 +0000
3+++ product/pricelist.py 2014-02-06 13:50:45 +0000
4@@ -206,7 +206,7 @@
5
6 if partner:
7 partner_where = 'base <> -2 OR %s IN (SELECT name FROM product_supplierinfo WHERE product_id = %s) '
8- partner_args = (partner, product_id)
9+ partner_args = (partner, tmpl_id)
10 else:
11 partner_where = 'base <> -2 '
12 partner_args = ()
13
14=== modified file 'purchase/purchase.py'
15--- purchase/purchase.py 2013-11-20 01:17:39 +0000
16+++ purchase/purchase.py 2014-02-06 13:50:45 +0000
17@@ -783,7 +783,7 @@
18
19 qty = qty or 1.0
20 supplierinfo = False
21- supplierinfo_ids = product_supplierinfo.search(cr, uid, [('name','=',partner_id),('product_id','=',product.id)])
22+ supplierinfo_ids = product_supplierinfo.search(cr, uid, [('name', '=', partner_id),('product_id', '=', product.product_tmpl_id.id)])
23 if supplierinfo_ids:
24 supplierinfo = product_supplierinfo.browse(cr, uid, supplierinfo_ids[0], context=context)
25 if supplierinfo.product_uom.id != uom_id:

Subscribers

People subscribed via source and target branches