Skip to content

Commit

Permalink
[UPT] product supplier info refers to the product template not the pr…
Browse files Browse the repository at this point in the history
…oduct_product
  • Loading branch information
AaronHForgeFlow committed Oct 10, 2016
1 parent 7cc490b commit 6481def
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions product_manufacturer_add_supplierinfo/models/product.py
Expand Up @@ -20,7 +20,7 @@ def _prepare_supplierinfo(self, cr, uid, product_id, context=None):
'product_code': product.manufacturer_pref,
'sequence': 99,
'min_qty': 1,
'product_id': product.id
'product_id': product.product_tmpl_id.id
}
return res

Expand All @@ -41,7 +41,7 @@ def write(self, cr, uid, ids, vals, context=None):
for product in self.browse(cr, uid, ids, context=context):
if 'manufacturer' in vals and vals['manufacturer']:
supp_ids = supplierinfo_obj.search(
cr, uid, [('product_id', '=', product.id),
cr, uid, [('product_id', '=', product.product_tmpl_id.id),
('name', '=', vals['manufacturer'])],
context=context)
if not supp_ids:
Expand Down

0 comments on commit 6481def

Please sign in to comment.