콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
14633 화면

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
3월 16
3646
0
12월 15
4734
3
8월 15
3677
Certification ODOO 해결 완료
2
7월 15
5430
1
3월 15
3563