Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
14448 มุมมอง

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
3492
0
ธ.ค. 15
4543
3
ส.ค. 15
3530
Certification ODOO แก้ไขแล้ว
2
ก.ค. 15
5280
1
มี.ค. 15
3425