Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
14315 Vizualizări

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.

Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează
Autor

Thanks for help

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

Cel mai bun răspuns

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.

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
0
mar. 16
3404
0
dec. 15
4457
3
aug. 15
3477
2
iul. 15
5190
1
mar. 15
3301