Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
14310 Visualizzazioni

Hello,

I find the attribute oldname in field definition.  Is there any use of oldname attribute?

'product_tmpl_id' : fields.many2one('product.template', 'Product Template', required=True, ondelete='cascade', select=True, oldname='product_id'),

Thanks in advance.

Avatar
Abbandona
Risposta migliore

HI Shamji,

'oldname' is the attribute used at time of migration.

oldname (string) -- the previous name of this field, so that ORM can rename it automatically at migration


Hope this helps...

Avatar
Abbandona
Autore

Thanks for help

Is oldname helpful to rename the field even if it has records in the database?

Risposta migliore

For 'oldname' and 'rename_fields' parameters is used for rename the column name in database but if we used this parameter then we lost data of this column from db.

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
mar 16
3398
0
dic 15
4446
3
ago 15
3471
2
lug 15
5169
1
mar 15
3290