Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
14124 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Autor

Thanks for help

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

Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
0
bře 16
3289
0
pro 15
4306
3
srp 15
3307
2
čvc 15
4999
1
bře 15
3155