Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
2 Vastaukset
2497 Näkymät

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
Hylkää
Paras vastaus

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

Avatar
Hylkää
Paras vastaus

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
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
3
helmik. 24
4074
0
tammik. 24
1816
1
heinäk. 21
6865
2
helmik. 24
3337
3
lokak. 21
15686