Skip to content
Snippets Groups Projects
Commit 180c4734 authored by Daniel Dico's avatar Daniel Dico Committed by Martin Trigaux
Browse files

[FIX] product_visible_discount: use order date to compute currency instead of current date

parent 9b3f3fec
No related branches found
No related tags found
No related merge requests found
......@@ -90,9 +90,11 @@ class sale_order_line(osv.osv):
if so_pricelist.visible_discount and list_price[pricelist] != 0 and new_list_price != 0:
if product.company_id and so_pricelist.currency_id.id != product.company_id.currency_id.id:
# new_list_price is in company's currency while price in pricelist currency
ctx = context.copy()
ctx['date'] = date_order
new_list_price = self.pool['res.currency'].compute(cr, uid,
product.company_id.currency_id.id, so_pricelist.currency_id.id,
new_list_price, context=context)
new_list_price, context=ctx)
discount = (new_list_price - price) / new_list_price * 100
if discount > 0:
result['price_unit'] = new_list_price
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment