[FIX] product: pricelists based on the supplier prices now return first supplier price if partner not in suppliers instead of returning 0

Without this, sale pricelists cannot be based on supplier prices as the partner is never a supplier so the price would be 0
Note: behavior change ok with fp
This commit is contained in:
David Monjoie 2014-11-03 17:20:15 +01:00
parent 66969f51fa
commit 3629bfe64f
1 changed files with 7 additions and 2 deletions

View File

@ -289,9 +289,14 @@ class product_pricelist(osv.osv):
price_tmp, round=False,
context=context)
elif rule.base == -2:
for seller in product.seller_ids:
if (not partner) or (seller.name.id != partner):
seller = False
for seller_id in product.seller_ids:
if (not partner) or (seller_id.name.id != partner):
continue
seller = seller_id
if not seller and product.seller_ids:
seller = product.seller_ids[0]
if seller:
qty_in_seller_uom = qty
from_uom = context.get('uom') or product.uom_id.id
seller_uom = seller.product_uom and seller.product_uom.id or False