Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
2399 Zobrazení

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
Zrušit
Nejlepší odpověď

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

Avatar
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
3
úno 24
3990
0
led 24
1750
1
čvc 21
6794
2
úno 24
3267
3
říj 21
15577