Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
4 Vastaukset
7983 Näkymät

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
Hylkää
Paras vastaus

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
Hylkää
Tekijä

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')

Tekijä

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

Tekijä

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.

Tekijä

yes that is the issue..

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

Paras vastaus

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

Avatar
Hylkää
Tekijä

Its already 4 decimal place..

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