Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
4 Ответы
7942 Представления

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.

Аватар
Отменить
Лучший ответ

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.
Аватар
Отменить
Автор

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

Автор

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

Автор

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.

Автор

yes that is the issue..

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

Лучший ответ

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

Аватар
Отменить
Автор

Its already 4 decimal place..

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