Merge lp:~openerp-dev/openobject-addons/6.1-opw-579011-rha into lp:openobject-addons/6.1

Proposed by Rifakat Husen (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-579011-rha
Merge into: lp:openobject-addons/6.1
Diff against target: 12 lines (+1/-1)
1 file modified
purchase/purchase.py (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-579011-rha
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Pending
Review via email: mp+123682@code.launchpad.net

Description of the change

Hello,

Fix domain of search() on product.supplierinfo, it searches for supplier on
onchange_product_id() with product_id instead of product_tmpl_id.

product.supplierinfo has relation with product.template, not with product.product
so when product_id and product_tmpl_id differs for any product in that case it
will cause problem.
(Courtesy to Niels Huylebroeck)

Thanks for your review.

Regards,
Rifakat Haradwala

To post a comment you must log in.
6985. By Rifakat Husen (OpenERP)

[IMP] purchase: useability, added space after comma

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

Hello,

This bug was qualified as Not Relevant on Trunk (means that architecture on trunk has changed and so this bug has no meaning anymore). 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

6985. By Rifakat Husen (OpenERP)

[IMP] purchase: useability, added space after comma

6984. By Niels Huylebroeck <email address hidden>

[FIX] purchase: search() on supplierinfo obj using product_tmpl_id instead od product_id,
product.supplierinfo has m2o relation with product.template, not product.product

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-07-25 17:07:19 +0000
3+++ purchase/purchase.py 2012-09-11 05:57:22 +0000
4@@ -777,7 +777,7 @@
5
6 qty = qty or 1.0
7 supplierinfo = False
8- supplierinfo_ids = product_supplierinfo.search(cr, uid, [('name','=',partner_id),('product_id','=',product.id)])
9+ supplierinfo_ids = product_supplierinfo.search(cr, uid, [('name', '=', partner_id), ('product_id', '=', product.product_tmpl_id.id)])
10 if supplierinfo_ids:
11 supplierinfo = product_supplierinfo.browse(cr, uid, supplierinfo_ids[0], context=context)
12 if supplierinfo.product_uom.id != uom_id: