Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
14362 Переглядів

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
3423
0
груд. 15
4476
3
серп. 15
3490
Certification ODOO Вирішено
2
лип. 15
5226
1
бер. 15
3321