İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
2831 Görünümler

my database value is 6205545687155.00000000

when I create journal entry by the create method of xmlrpc , the value in odoo change to  6205545687155.000977     

my python code :

debit_journal_item = {
'move_id': journal_entry_id,
'account_id'
: 3095,
'amount_currency'
: float(item[1]),
'currency_id'
: item[0],
'analytic_account_id'
: 89,
'debit'
: float(item[2])
}
journal_items.append(debit_journal_item)
models.execute_kw(db_name, uid, pwd, 'account.move.line', 'create', [journal_items])
Avatar
Vazgeç
En İyi Yanıt

It looks like the issue you are experiencing might be related to a rounding error. When you create a journal entry with an amount of 6205545687155.00000000, the value gets rounded to 6205545687155.000977 in Odoo.

One potential solution to this issue would be to set the decimal precision for the 'amount' field in the 'account.move.line' model to a higher value. This will allow you to store more decimal places for the journal entry amounts, and avoid any rounding errors.

To do this, you can use the 'set_precision' method of the 'decimal.precision' class in the 'decimal_precision' module. Here is an example of how you could use this method to set the decimal precision for the 'amount' field in the 'account.move.line' model:

from decimal import precision

# Set the decimal precision for the 'amount' field in the 'account.move.line' model
# to 20 decimal places
decimal.precision('Account Move Line Amount').set_precision(20)

Once you have set the decimal precision for the 'amount' field, you should be able to create journal entries with higher precision amounts, and avoid any rounding errors.

Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
2
Tem 25
1558
0
Oca 24
1534
1
Kas 23
1799
1
Eyl 23
2476
1
Ara 24
1651