Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
7433 Lượt xem

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")
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất
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.
Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 5 17
3499
7
thg 10 18
10450
2
thg 9 18
5975
1
thg 4 18
9543
1
thg 4 18
3406