跳至内容
菜单
此问题已终结
1 回复
870 查看

Hello Odoo Community,

My main currency is IQD, and the transaction currency sometimes is IQD and sometimes USD. I have added two fields in the journal items and used Studio to write the following code in Compute field :

self[:1].currency_id._convert(self.debit, self[:1].company_id.currency_id, self[:1].company_id, self[:1].date) if self else 0
self[:1].currency_id._convert(self.credit, self[:1].company_id.currency_id, self[:1].company_id, self[:1].date) if self else 0

However, when I create a transaction, I want to see USD Debit and USD Credit correctly displayed in the journal items.

Can anyone help me achieve this? Am I missing something in my approach?

or any other way to solve for see debit and credit in use? 

Thanks in advance!


形象
丢弃
最佳答案

Hi, I think that you are trying to display original currency which had been posted of the transactions. If yes, there is no need to compute such complex method, there is a field called 'Amount in Currency' which is stored the original currency value while making that transaction. Please try with that field at your view by doing drag and drop with Studio at your list view.

形象
丢弃
编写者

Hi @gladiator,

Thank you for your response!

I understand that the "Amount in Currency" field stores the original currency value of the transaction. However, I have noticed two issues:

The "Amount in Currency" field does not differentiate between Debit and Credit values. I need to clearly see both USD Debit and Credit separately.
Some transactions are recorded in IQD (which is my main currency), but when I create a transaction in IQD, the "Amount in Currency" field does not store this amount. It remains empty or does not reflect the correct value.
Do you know how I can fix these issues? Or do I need to apply a different approach to achieve my goal?

Thanks again for your help!

But 'Amount in Currency' Field always store value of current transactions currency amount, there is no chance to be as Empty Value, if yes, please check any of your custom module or third party module.

Note - Your goal doesn't meet international accounting standard, accountants always keep and register at credit and debit side with their company base Currency amount with their transaction date of exchange rate, not register with secondary currency at debit and credit side.

编写者

When I create a transaction in USD, the "Amount in Currency" field stores the correct values.
But when I create a transaction in IQD (which is my main currency), the "Amount in Currency" field does not store any value.
My goal is to always see the Debit and Credit in USD, even for transactions made in IQD. This means I need to have a secondary currency column that converts IQD to USD dynamically.

相关帖文 回复 查看 活动
0
6月 19
1867
0
2月 19
4784
2
3月 24
3991
Open a URL 已解决
2
10月 22
6505
2
1月 22
4722