Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
14903 Tampilan

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
Buang
Jawaban Terbai

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
Buang
Penulis

Thanks for help

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

Jawaban Terbai

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
Buang
Post Terkait Replies Tampilan Aktivitas
0
Mar 16
3780
0
Des 15
4949
3
Agu 15
3888
2
Jul 15
5542
1
Mar 15
3706