Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
7385 Vizualizări

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")
Imagine profil
Abandonează
Cel mai bun răspuns
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.
Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
mai 17
3447
7
oct. 18
10407
2
sept. 18
5920
1
apr. 18
9502
1
apr. 18
3377