Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
2404 Tampilan

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
Buang
Jawaban Terbai

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

Avatar
Buang
Jawaban Terbai

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
Buang
Post Terkait Replies Tampilan Aktivitas
3
Feb 24
3990
0
Jan 24
1756
1
Jul 21
6796
2
Feb 24
3271
3
Okt 21
15582