From 39a8b39a288d8909e53e71f75f6d06ab2d384bc9 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Mon, 24 Oct 2016 11:56:42 +0200 Subject: [PATCH] [FIX] product: variant name_get for specific providers This is related to revision b65c67a2598fd3ad433af05ed49d398c473b76ae The field `seller_ids` is a field which is set on the `product.template`, and this is why the condition `(x.product_id == product)` is being applied in the list comprehension searching the current seller of the product sellers. The `variant` variable is a string containing the attribute name of a variant. Therefore, if a product tempalte has only one variant, without any attribute (e.g. when you don't use variants), `variant` will be empty, and therefore the condition `if variant:` will be `False`, and therefore it won't search in the product sellers with a specific `product.product`, while it should, as, even if there are no attributes, there could be a seller line with this specific `product.product`. Besides, as we are in the `name_get` of `product.product`, and not the `name_get` of `product.template`, we are always in the case of a `variant`, this test is therefore pointless. opw-682390 --- addons/product/product.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/product/product.py b/addons/product/product.py index 4a916ad14a9..fed52c552ec 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -1077,8 +1077,7 @@ class product_product(osv.osv): name = variant and "%s (%s)" % (product.name, variant) or product.name sellers = [] if partner_ids: - if variant: - sellers = [x for x in product.seller_ids if (x.name.id in partner_ids) and (x.product_id == product)] + sellers = [x for x in product.seller_ids if (x.name.id in partner_ids) and (x.product_id == product)] if not sellers: sellers = [x for x in product.seller_ids if (x.name.id in partner_ids) and not x.product_id] if sellers: