Odooers论坛

欢迎!

该社区面向专业人士和我们产品和服务的爱好者。
分享和讨论最好的内容和新的营销理念,建立您的专业形象,一起成为更好的营销人员。


0

Currency Converter according to exchange rate date and invoice date V15

形象
odoo
形象
丢弃
1 答案
0
形象
odoo
最佳答案

Hi Muhammad Kamil,
Compute function has already that functionality. You need to pass the date with context and called the compute method from the currency model.Please try with this code.

    convert_currency = currency.with_context(date= your invoice date).compute(amount, SAR)


This will find the currency rate <= to your invoice date.
Hope it will help you
Please Vote for the Answer if works.

2 注释
形象
丢弃
形象
odoo
-

Hi Malay,

I'm trying it from € to usd in qweb

<t t-set="convert_currency" t-value="o.currency_id.with_context(date = o.date).compute(o.amount_total, USD)" />
<t t-esc="convert_currency" />
but it doesn't work, it show the same amount, what I'm doing wrong?
br

形象
odoo
-

Hi,
Please check your record currency "o.currency_id".
Please check the date "o.date" and the currency rate for the USD.

Please check the condition of currency rate date <= to your invoice date.

Hope it will help you.