From 43a2d31e05d1aa65a8d3b32538406fd1ad8eb3cc Mon Sep 17 00:00:00 2001 From: Amit Dodiya Date: Fri, 8 Jun 2012 18:45:15 +0530 Subject: [PATCH] [FIX] Currency symbol position is not changed as per currency(after/before) configuration bzr revid: ado@openerp.com-20120608131515-ox0plwn3qzj2oimm --- addons/account_payment/report/order.rml | 8 ++++---- addons/product/report/product_pricelist.py | 5 +++-- addons/product/report/product_pricelist.rml | 10 +++++----- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/addons/account_payment/report/order.rml b/addons/account_payment/report/order.rml index 973588e5410..da6269c7b00 100644 --- a/addons/account_payment/report/order.rml +++ b/addons/account_payment/report/order.rml @@ -256,10 +256,10 @@ [[line.date=='False' and '-' or formatLang(line.date,date=True) ]] - [[formatLang(line.amount) or '-' ]] [[get_company_currency_symbol()]] + [[ formatLang((line.amount) or '-', currency_obj=line.currency) ]] - [[ formatLang(line.amount_currency) ]] [[ line.currency.symbol]] + [[ formatLang(line.amount_currency, currency_obj=line.currency) ]] @@ -275,10 +275,10 @@ Total: - [[ formatLang(get_amount_total(o)) or '' ]] [[get_company_currency_symbol()]] + [[ formatLang(get_amount_total(o), currency_obj=o.company_id.currency_id) ]] - [[ formatLang(get_amount_total_in_currency(o)) or '' ]] [[get_company_currency_symbol()]] + [[ formatLang(get_amount_total_in_currency(o), currency_obj=o.company_id.currency_id)]] diff --git a/addons/product/report/product_pricelist.py b/addons/product/report/product_pricelist.py index 7e9748c2523..2ba67f896ab 100644 --- a/addons/product/report/product_pricelist.py +++ b/addons/product/report/product_pricelist.py @@ -114,12 +114,13 @@ class product_pricelist(report_sxw.rml_parse): def _get_price(self,pricelist_id, product_id,qty): sale_price_digits = self.get_digits(dp='Sale Price') pool = pooler.get_pool(self.cr.dbname) + currency_record = self.pool.get('product.pricelist').browse(self.cr, self.uid, [pricelist_id], context=self.localcontext)[0] price_dict = pool.get('product.pricelist').price_get(self.cr, self.uid, [pricelist_id], product_id, qty, context=self.localcontext) if price_dict[pricelist_id]: - price = self.formatLang(price_dict[pricelist_id], digits=sale_price_digits) + price = self.formatLang(price_dict[pricelist_id], digits=sale_price_digits, currency_obj=currency_record.currency_id) else: res = pool.get('product.product').read(self.cr, self.uid, [product_id]) - price = self.formatLang(res[0]['list_price'], digits=sale_price_digits) + price = self.formatLang(res[0]['list_price'], digits=sale_price_digits, currency_obj=currency_record.currency_id) return price report_sxw.report_sxw('report.product.pricelist','product.product','addons/product/report/product_pricelist.rml',parser=product_pricelist) diff --git a/addons/product/report/product_pricelist.rml b/addons/product/report/product_pricelist.rml index 14bf02300bc..62f1dc4ef4b 100644 --- a/addons/product/report/product_pricelist.rml +++ b/addons/product/report/product_pricelist.rml @@ -240,19 +240,19 @@ [[ p['code'] and '[' + p['code'] + '] ' or '' ]] [[ p['name'] ]] - [[ (p.has_key('qty1') and p['qty1']) or '' ]] [[ (k.has_key('qty1') and get_currency_symbol ( data['form']['price_list'])) or '' ]] + [[ (p.has_key('qty1') and p['qty1']) or '' ]] - [[ (p.has_key('qty2') and p['qty2']) or '' ]] [[ (k.has_key('qty2') and get_currency_symbol ( data['form']['price_list'])) or '' ]] + [[ (p.has_key('qty2') and p['qty2']) or '' ]] - [[ (p.has_key('qty3') and p['qty3']) or '' ]] [[ (k.has_key('qty3') and get_currency_symbol ( data['form']['price_list'])) or '' ]] + [[ (p.has_key('qty3') and p['qty3']) or '' ]] - [[ (p.has_key('qty4') and p['qty4']) or '' ]] [[ (k.has_key('qty4') and get_currency_symbol ( data['form']['price_list'])) or '' ]] + [[ (p.has_key('qty4') and p['qty4']) or '' ]] - [[ (p.has_key('qty5') and p['qty5']) or '' ]] [[ (k.has_key('qty5') and get_currency_symbol ( data['form']['price_list'])) or '' ]] + [[ (p.has_key('qty5') and p['qty5']) or '' ]]