Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
5918 Lượt xem

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.

 

 

 

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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>

 

 

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 9 17
6351
1
thg 6 16
10443
1
thg 4 24
1624
2
thg 1 24
1728
Error message Đã xử lý
2
thg 11 23
2595