Skip to Content
Menú
This question has been flagged
1 Respondre
5915 Vistes

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.

 

 

 

Avatar
Descartar
Best Answer

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>

 

 

Avatar
Descartar
Related Posts Respostes Vistes Activitat
1
de set. 17
6341
1
de juny 16
10442
1
d’abr. 24
1622
2
de gen. 24
1727
2
de nov. 23
2593