Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
14292 Widoki

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.

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Autor

Thanks for help

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

Najlepsza odpowiedź

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.

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
mar 16
3394
0
gru 15
4440
3
sie 15
3454
2
lip 15
5140
1
mar 15
3273