跳至内容
菜单
此问题已终结
1 回复
7366 查看

Hello,

I want to override the price field from decimal.precision, but It didn't work with that:

Why is that so? Can someone help me?

Edit: Is the _name variable required when I only want to override a field on a model? 


from odoo import api, fields, models, tools, _
import odoo.addons.decimal_precision as dp


class SupplierInfo(models.Model):
_inherit = 'product.supplierinfo'

price = fields.Float('Price', default=0.0, digits=dp.get_precision('Product Buy Price'), required=True, help="The price to purchase a PRODUCT")
形象
丢弃
最佳答案
I have tried your code in my local and its working fine as I have changed label by "price" to "price123" and it is working fine you just need to restart the server and upgrade module.

Hope this will help you.
Thanks.
形象
丢弃
相关帖文 回复 查看 活动
1
5月 17
3434
7
10月 18
10392
2
9月 18
5900
1
4月 18
9481
1
4月 18
3371