Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
14338 Lượt xem

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.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Tác giả

Thanks for help

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

Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 3 16
3420
0
thg 12 15
4472
3
thg 8 15
3485
Certification ODOO Đã xử lý
2
thg 7 15
5220
1
thg 3 15
3317