From 3629bfe64f56c020498abd041f93e72f5864de8e Mon Sep 17 00:00:00 2001 From: David Monjoie Date: Mon, 3 Nov 2014 17:20:15 +0100 Subject: [PATCH] [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 --- addons/product/pricelist.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/addons/product/pricelist.py b/addons/product/pricelist.py index d212a747217..35be803ea39 100644 --- a/addons/product/pricelist.py +++ b/addons/product/pricelist.py @@ -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