Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
2420 Visualizzazioni

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
Abbandona
Risposta migliore

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

Avatar
Abbandona
Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
3
feb 24
4017
0
gen 24
1785
1
lug 21
6811
2
feb 24
3292
3
ott 21
15595