Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
2355 Vistas

Hi friends,

For a multicurrency company, one important question is: How much is the balance of one account in its related currency?

On the *Journal Items* view, grouping the list by *Journal* and then by *Account* will give us the last balance of each account. But Odoo doesn't sum the column *Amount in Currency*  and gives just the sum of the Debit and Credit columns.

How can we have the sum for the column *Amount in Currency*? The related field is *amount_currency*.

I read multiple previous questions and answers and all those, suggest that putting sum="Total" on the field will give the sum. I put the attribute sum="Total" on the field *amount_currency*  but it still does not give SUM.

The field amount_currency is defined as:

amount_currency = fields.Monetary(        
​string='Amount in Currency',
group_operator=None,
compute='_compute_amount_currency'
inverse='_inverse_amount_currency',
store=True,
readonly=False,
precompute=True,
help="The amount expressed in an optional other currency if it is a multi-currency entry."
)

As we see, the field is computed and has the attribute store=True. So, we can put attribute sum="Total" on the field.

Odoo also did similar work and put the 'sum' attribute on the Debit and Credit columns and they are working well.

On Odoo 14 community, we can see the sum for the column *amount_currency*. 

This picture shows what I want on the Odoo 14 community and shows the sum for column Amount in Currency as you see. This feature disappears in Odoo 17.

Avatar
Descartar
Mejor respuesta

Hi in code you can amount_currency = fields.Monetary(group_operator="sum")

Avatar
Descartar
Mejor respuesta

we are facing the exact same problem (multi currency company). 
sum attribute doesn't work, but is crucial for some reports.

Really appreciate a solution here.

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
3
feb 24
3932
0
ene 24
1706
1
jul 21
6754
2
feb 24
3215
3
oct 21
15547