Se rendre au contenu
Menu
Cette question a été signalée
2 Réponses
14305 Vues

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
Ignorer
Meilleure réponse

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
Ignorer
Auteur

Thanks for help

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

Meilleure réponse

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
Ignorer
Publications associées Réponses Vues Activité
0
mars 16
3398
0
déc. 15
4442
3
août 15
3465
2
juil. 15
5160
1
mars 15
3280