[FIX] product: variant name_get for specific providers
This is related to revision
b65c67a259
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
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user