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

how to pass value to reference field from code?

아바타
취소
베스트 답변

HI,

The field value is .

Reference field Basically stored as a :class:`string ` following the pattern "res_model,res_id" in the database. It Display as the selection . If you want to pass the value to the reference field, then you have to pass the formation value in the field where the first argument is the record model and second argument will be the id of that model.
Like:

    reference_record = '%s,%s' % (res_model, res_id)

    reference_field_record = '%s,%s' % ('ir.actions.act_window', 11)

Hope it will help you.
Thanks.

아바타
취소
작성자 베스트 답변

thanks, i also know that _name return the model name :)

아바타
취소
관련 게시물 답글 화면 활동
2
7월 22
4407
3
12월 21
4145
3
7월 23
5532
2
3월 24
5545
1
11월 22
5298