Odoo Help

Welcome!

This community 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.

0

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

By
samba
on 7/15/14, 3:45 AM 720 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

--Maniganda--
1038
| 5 7 7
Bangalore, India
--Maniganda--
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>

 

 

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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