I need a monetary field to keep 5 decimal places (e.g. 12.34567), but Odoo version 18.0 enterprise keeps rounding to the currency’s precision (2 decimals for my company currency).
Here is my code:
class AccountPaymentRegister(models.TransientModel):
_inherit = 'account.payment.register'
bank_charges = fields.Monetary(
string='Bank Charges',
currency_field='currency_id',
)
class AccountJournal(models.Model):
_inherit = 'account.journal'
default_bank_charge_amount = fields.Monetary(
string='Default Bank Charge Amount',
currency_field='company_currency_id',
help='Default bank charge amount to prefill in the Pay wizard.',
)
I tried:
- Setting
digits=(16, 5)on the field → seems ignored byMonetary. - Changing only the widget in the view.
Expected: store and display 5 decimals.
Actual: values are rounded to the currency precision.
Is there a supported way to have 5 decimals on a Monetary field, without changing the company currency for everything? If not, what is the recommended pattern?