Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
14304 Представления

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.

Аватар
Отменить
Related Posts Ответы Просмотры Активность
0
мар. 16
3397
0
дек. 15
4442
3
авг. 15
3464
2
июл. 15
5157
1
мар. 15
3278