[REVERT] rev 8788.1.1769: The exchange rate of the currency of the pricelist should not be applied as this price computation method does not depends of any pricelist

bzr revid: dle@openerp.com-20140226172300-z2okr3vpjuwxs4mz
This commit is contained in:
Denis Ledoux 2014-02-26 18:23:00 +01:00
parent 50ecb598e7
commit 70d3f251a3
2 changed files with 5 additions and 14 deletions

View File

@ -548,15 +548,10 @@ class product_product(osv.osv):
_product_incoming_qty = _get_product_available_func(('confirmed','waiting','assigned'), ('in',))
def _product_lst_price(self, cr, uid, ids, name, arg, context=None):
res = dict.fromkeys(ids, 0.0)
res = {}
product_uom_obj = self.pool.get('product.uom')
# retrieve pricelist
pricelist = None
if context.get('pricelist'):
pricelist = self.pool['product.pricelist'].browse(cr, uid, context.get('pricelist'), context=context)
base_currency = self.pool['res.users'].browse(cr, uid, uid, context=context).company_id.currency_id
for id in ids:
res.setdefault(id, 0.0)
for product in self.browse(cr, uid, ids, context=context):
if 'uom' in context:
uom = product.uos_id or product.uom_id
@ -564,11 +559,7 @@ class product_product(osv.osv):
uom.id, product.list_price, context['uom'])
else:
res[product.id] = product.list_price
res[product.id] = (res[product.id] or 0.0) * (product.price_margin or 1.0) + product.price_extra
# update the result, according to the eventual pricelist currency
if pricelist and pricelist.currency_id:
res[product.id] = self.pool['res.currency'].compute(
cr, uid, base_currency.id, pricelist.currency_id.id, res[product.id], round=False, context=context)
res[product.id] = (res[product.id] or 0.0) * (product.price_margin or 1.0) + product.price_extra
return res
def _save_product_lst_price(self, cr, uid, product_id, field_name, field_value, arg, context=None):

View File

@ -69,7 +69,7 @@
<h5><strong><a t-attf-href="/shop/product/{{ slug(product) }}/?{{ keep_query('search', 'filters', category=(category and int(category)), page=(pager['page']['num'] if pager['page']['num']>1 else None)) }}" t-field="product.name"/></strong></h5>
<div class="product_price" t-if="product.product_variant_ids">
<b>
<t t-if="abs(product.product_variant_ids[0].lst_price - product.product_variant_ids[0].price) &gt; 0.2">
<t t-if="product.product_variant_ids[0].lst_price != product.product_variant_ids[0].price">
<del class="text-danger"
t-field="product.product_variant_ids[0].lst_price" t-field-options='{
"widget": "monetary",