Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
1014 Vistas

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!


Avatar
Descartar
Mejor respuesta

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.

Avatar
Descartar
Autor

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.

Autor

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.

Publicaciones relacionadas Respuestas Vistas Actividad
0
jun 19
1867
0
feb 19
4845
2
mar 24
4185
Open a URL Resuelto
2
oct 22
6633
2
ene 22
4861