[FIX] product: avoid name_get with empty ()

Products with a seller name but no attributes (only one variant) got their name
in the format 'seller name ()'
Fixes #4523
This commit is contained in:
Martin Trigaux 2015-01-06 18:22:54 +01:00
parent 6916acdb1d
commit 25c3348a1f
1 changed files with 3 additions and 1 deletions

View File

@ -1040,7 +1040,9 @@ class product_product(osv.osv):
sellers = filter(lambda x: x.name.id in partner_ids, product.seller_ids)
if sellers:
for s in sellers:
seller_variant = s.product_name and "%s (%s)" % (s.product_name, variant) or False
seller_variant = s.product_name and (
variant and "%s (%s)" % (s.product_name, variant) or s.product_name
) or False
mydict = {
'id': product.id,
'name': seller_variant or name,