Skip to Content
Menu
This question has been flagged
2 Replies
14397 Rodiniai

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.

Portretas
Atmesti
Best Answer

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...

Portretas
Atmesti
Autorius

Thanks for help

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

Best Answer

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.

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
0
kov. 16
3439
0
gruod. 15
4496
3
rugp. 15
3509
2
liep. 15
5243
1
kov. 15
3359