Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
4 Odgovori
7938 Prikazi

Hi,
I want to change decimal precision for journal entries "amount" Monetary field  now its showing in 2 digits.. I wanted it in 4.. I tried with Database Structure-> Decimal Accuracy, but its not working... any other setting needs to do from accounting in odoo 10? Please help.

Avatar
Opusti
Best Answer

Hello 

you have to inherit the fields into your module. and add the decimal precision for that field

for eg. 

import odoo.addons.decimal_precision as dp

class account_move(models.Model):
    _inherit = 'account.move'
    
    amount = fields.Monetary(compute='_amount_compute', store=True, 
        digits=dp.get_precision('Your Decimal Accuracy name'))

Try with above code change, i hope this  will helps you.
Avatar
Opusti
Avtor

Hi Mitul,

I have tried this , but its not working.

did you tried to create your own decimal accuracy? and then inherit the amount field into your module and set the decimal accuracy into the field like i have set in above example. for eg. digits=dp.get_precision('Your Decimal Accuracy name')

Avtor

Yes Mitul, I same flow i applied but still its not working.

Avtor

In tree view it shows 4 decimal places.. but If I open one of them in amount field it shows only 2 decimal

I am not sure but i think the issue is with the monetary widget/field. If you try this with float field it's working fine. but while you use fields.Monetary or widget="monetary" at that time the decimal accuracy is not working.

Avtor

yes that is the issue..

but I tried with by converting amount field in fields.Float as well, still same .. not working.

Best Answer

Find your currency definition (menu Accouting/.../Currencies) and set the Rounding Factor = 0.0001

Avatar
Opusti
Avtor

Its already 4 decimal place..

I want 4 decimal place to apply only amount field from account.move..