Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
5420 Представления
Hello, when creating a new field and using the digits parameter to define a decimal precision, I get this error:

unknown parameter 'digits', if this is an actual parameter you may want to override the method _valid_field_parameter on the relevant model in order to allow it

My code is:

energy_ceiling = fields.Monetary(string='Techo US$/MWh (MAX)', digits=dp.get_precision('cec_monetary'))

I added the decimal precision record with this code:

forcecreate="True" id="cec_values" model="decimal.precision">
name="name">CEC Valores Contrato
name="digits">4

I can see the record loaded on Odoo.


Please advice.


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

Hi, 
in odoo15 Its Deprecated call to decimal_precision.get_precision(application), use digits=application instead. 

So as per your code use like :

       energy_ceiling = fields.Monetary(string='Techo US$/MWh (MAX)', digits='CEC Valores Contrato')

Hope it will help you.

Аватар
Отменить
Related Posts Ответы Просмотры Активность
0
мар. 25
1381
4
апр. 24
174296
0
дек. 23
2184
5
июл. 25
228108
1
дек. 22
3301