Odoo Help


How to print the Trial Balance, Profit & Loss and Balance sheet in the other currencies

on 8/4/14, 7:11 AM 1,333 views

As of now, the trail balance, profit and loss and balance sheet are prinited in the currency (base currency of the company).

If I want to print all the above said report in other currencies (user selection) how to generate the report.

Could somebody guide in this please


On 8/5/14, 3:07 AM

Hi Ben Bernard

Thanks for your reply.  But am not using the webkit report.  Just am using the default reports (TB, P&L and BS).

Could you help me out in this regards



I updated my answer. Good luck.

Ben Bernard
on 8/5/14, 3:53 AM

Ben Bernard

--Ben Bernard--

| 4 3 6
Jakarta, Indonesia
--Ben Bernard--
Ben Bernard
On 8/4/14, 8:06 AM

As a note, converting currency is depend on time. You can define currencies in res.currency model (Accounting > Configuration > Miscelaneous > Currencies). In the following example I assume you use account_financial_report_webkit module (to access python easier), system currency in USD and want to convert to IDR. Check account_report_trial_balance.mako. In this file add the following script.

date = time.strftime('%Y-%m-%d')

rate_pool = self.pool.get('res.currency.rate')

curr_pool = self.pool.get('res.currency')

curr_id = curr_pool.search(cr, uid, [('name', '=', 'IDR')])[0]

rate_ids = rate_pool.search(cr, uid, [('currency_id', '=', curr_id),
                                              ('name', '<=', date)], context=context)

rate_obj = rate_pool.browse(cr, uid, rate_ids[0], context=context)
rate = rate_obj.rate

Then in every occurence of amount, multiply this by rate. For example,

formatLang(current_account.debit * rate)

-- begin updated answer --

What is the default? It depends on Odoo version (last time I check Odoo migrating to QWeb). I don't have experience using QWeb. If you still use sxw, then you can transfer result of some method that generate the rate and call it in the sxw file. Check python script that generate data for sxw file (in folder report), then

  1. Define new method in that file, for example example get_converted_value(self, object), with return value = {'val': rate * value, 'currecy_id': curr_id}. Where value is amount you want to convert.
  2. In __init__ update localcontext hash to include get_converted_value. self.localcontext.update({ 'get_converted_value': self.get_converted_value})
  3. Go to corresponding sxw file, usually the same name with extension .sxw. Open it in OpenERP Designer addons for OpenOffice.
    1. call get_converted_value, something like

[[ repeatIn(get_converted_value(object), 'value') ]]

Value: [[ formatLang(value['val'], currency_obj=value['currency_id']) ]]





About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 8/4/14, 7:11 AM
Seen: 1333 times
Last updated: 3/16/15, 8:10 AM