تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
14308 أدوات العرض

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.

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
مارس 16
3398
0
ديسمبر 15
4444
3
أغسطس 15
3469
Certification ODOO تم الحل
2
يوليو 15
5165
1
مارس 15
3285