Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
6115 Visualizzazioni

I have some field with string name Provider
In different cases i need to change Provider for another field name. How can i do it? What function i need to overwrite?
Thank's

res_pr = fields.Char(string='Provider')


Avatar
Abbandona
Risposta migliore

Lets suppose you have model A defined as below:


from odoo import fields, models, api, _

class A(models.Model):
_name = 'A'
   field_name = fields.char(string='Provider')

So you will inherit the model and override the field as below:

from odoo import fields, models, api, _
class A(models.Model):
_inherit = "A"

   field_name = fields.char(string='New Name')


Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
set 19
7
0
apr 18
3414
0
lug 20
7235
1
mar 25
920
0
mag 17
5624