[MERGE] OPW 575624: product,account_payment: respect current symbol position in reports
bzr revid: odo@openerp.com-20120618092442-ae3s7n1yeckmgk1f
This commit is contained in:
commit
125fb808f4
|
@ -256,10 +256,10 @@
|
|||
<para style="terp_default_Centre_9">[[line.date=='False' and '-' or formatLang(line.date,date=True) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[formatLang(line.amount) or '-' ]] [[get_company_currency_symbol()]] </para>
|
||||
<para style="terp_default_Right_9">[[ formatLang((line.amount) or '-', currency_obj=line.currency) ]] </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(line.amount_currency) ]] [[ line.currency.symbol]] </para>
|
||||
<para style="terp_default_Right_9">[[ formatLang(line.amount_currency, currency_obj=line.currency) ]] </para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
@ -275,10 +275,10 @@
|
|||
<para style="terp_default_Bold_9">Total:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(get_amount_total(o)) or '' ]] [[get_company_currency_symbol()]] </para>
|
||||
<para style="terp_default_Right_9">[[ formatLang(get_amount_total(o), currency_obj=o.company_id.currency_id) ]] </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(get_amount_total_in_currency(o)) or '' ]] [[get_company_currency_symbol()]] </para>
|
||||
<para style="terp_default_Right_9">[[ formatLang(get_amount_total_in_currency(o), currency_obj=o.company_id.currency_id)]] </para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
|
|
@ -33,7 +33,7 @@ class product_pricelist(report_sxw.rml_parse):
|
|||
'time': time,
|
||||
'get_pricelist': self._get_pricelist,
|
||||
'get_currency': self._get_currency,
|
||||
'get_currency_symbol': self._get_currency_symbol,
|
||||
'get_currency_symbol': self._get_currency_symbol, # TODO 7.0 - remove this - unused
|
||||
'get_categories': self._get_categories,
|
||||
'get_price': self._get_price,
|
||||
'get_titles': self._get_titles,
|
||||
|
@ -70,6 +70,7 @@ class product_pricelist(report_sxw.rml_parse):
|
|||
pricelist = pool.get('product.pricelist').read(self.cr, self.uid, [pricelist_id], ['currency_id'], context=self.localcontext)[0]
|
||||
return pricelist['currency_id'][1]
|
||||
|
||||
# TODO 7.0 - remove this method, its unused
|
||||
def _get_currency_symbol(self, pricelist_id):
|
||||
pool = pooler.get_pool(self.cr.dbname)
|
||||
pricelist = pool.get('product.pricelist').read(self.cr, self.uid, [pricelist_id], ['currency_id'], context=self.localcontext)[0]
|
||||
|
@ -114,12 +115,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)
|
||||
pricelist = 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=pricelist.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=pricelist.currency_id)
|
||||
return price
|
||||
|
||||
report_sxw.report_sxw('report.product.pricelist','product.product','addons/product/report/product_pricelist.rml',parser=product_pricelist)
|
||||
|
|
|
@ -240,19 +240,19 @@
|
|||
<para style="terp_default_9">[[ p['code'] and '[' + p['code'] + '] ' or '' ]] [[ p['name'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9_Bold">[[ (p.has_key('qty1') and p['qty1']) or '' ]] [[ (k.has_key('qty1') and get_currency_symbol ( data['form']['price_list'])) or '' ]]</para>
|
||||
<para style="terp_default_Right_9_Bold">[[ (p.has_key('qty1') and p['qty1']) or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9_Bold">[[ (p.has_key('qty2') and p['qty2']) or '' ]] [[ (k.has_key('qty2') and get_currency_symbol ( data['form']['price_list'])) or '' ]]</para>
|
||||
<para style="terp_default_Right_9_Bold">[[ (p.has_key('qty2') and p['qty2']) or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9_Bold">[[ (p.has_key('qty3') and p['qty3']) or '' ]] [[ (k.has_key('qty3') and get_currency_symbol ( data['form']['price_list'])) or '' ]]</para>
|
||||
<para style="terp_default_Right_9_Bold">[[ (p.has_key('qty3') and p['qty3']) or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9_Bold">[[ (p.has_key('qty4') and p['qty4']) or '' ]] [[ (k.has_key('qty4') and get_currency_symbol ( data['form']['price_list'])) or '' ]]</para>
|
||||
<para style="terp_default_Right_9_Bold">[[ (p.has_key('qty4') and p['qty4']) or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9_Bold">[[ (p.has_key('qty5') and p['qty5']) or '' ]] [[ (k.has_key('qty5') and get_currency_symbol ( data['form']['price_list'])) or '' ]]</para>
|
||||
<para style="terp_default_Right_9_Bold">[[ (p.has_key('qty5') and p['qty5']) or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
|
Loading…
Reference in New Issue