Odoo Help

0

How can i display company default currency symbol in my inherited views?

By
samba
on 7/15/14, 3:45 AM 938 views

I have inherited a model "account_invoice" and also inherited a view "account.invoice_form".

I want to dispay invoice total amount in compay currency, I have converted it using extra functional field "amount_toatl_cc". But i unable to display company currency symbol. Please help me with the below code

<xpath expr="/form/sheet/notebook/page/group/field[@name='amount_total']" position="after">
                <field name="amount_toatl_cc" widget="monetary" options="{'currency_field':'company_id.currency_id'}"/>
            </xpath>

Symbol not showing with above code. 

If i write "currency_id" inplace of "company_id.currency_id" it is showing selected currency symbol, but i need company currency symbol .

Thank you.

 

 

 

0
Maniganda
On 7/15/14, 10:20 AM

create a related field based on company_id to fetch the company currency_id

'company_currency_id': fields.related('company_id','currency_id',type='many2one',relation='res.currency',string='Company currency',store=True,readonly=True)

and include 'company_currency_id' in options to get the company currency symbol

<xpath expr="/form/sheet/notebook/page/group/field[@name='amount_total']" position="after">
                <field name="amount_toatl_cc" widget="monetary" options="{'currency_field':'company_currency_id'}"/>
            </xpath>

 

 

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.

Register

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)

Stats

Asked: 7/15/14, 3:45 AM
Seen: 938 times
Last updated: 3/16/15, 8:10 AM