Skip to content
Snippets Groups Projects
Commit 12df3c6a authored by Denis Ledoux's avatar Denis Ledoux
Browse files

[FIX] product: name_get, products can share the same template

Oversight in revision
a91ffcf1

Multiple products can have the same template.

Passing multiple times the same template id
to the search domain to get the sellers
works, but better avoid the repetition
for the performances.
parent a91ffcf1
No related branches found
No related tags found
No related merge requests found
......@@ -398,9 +398,9 @@ class ProductProduct(models.Model):
# Prefetch the fields used by the `name_get`, so `browse` doesn't fetch other fields
# Use `load=False` to not call `name_get` for the `product_tmpl_id`
self.sudo().read(['name', 'default_code', 'product_tmpl_id', 'attribute_value_ids'], load=False)
products = self.sudo().read(['name', 'default_code', 'product_tmpl_id', 'attribute_value_ids'], load=False)
product_template_ids = [product.product_tmpl_id.id for product in self]
product_template_ids = list(set(product['product_tmpl_id'] for product in products))
if partner_ids:
supplier_info = self.env['product.supplierinfo'].sudo().search([
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment