コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
14328 ビュー

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.

アバター
破棄
最善の回答

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

アバター
破棄
著作者

Thanks for help

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

最善の回答

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.

アバター
破棄
関連投稿 返信 ビュー 活動
0
3月 16
3415
0
12月 15
4464
3
8月 15
3483
2
7月 15
5215
1
3月 15
3306