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

I have a transient model defined.

I want one of its fields defined using active_id from context.

I want to use new API.

Does anyone know how to do it? Thanks

아바타
취소
베스트 답변

Hello EM,


@api.model

 def default_get(self, fields):

    rec = super(TransientModelClass, self).default_get(fields)

    class_obj = self.env['class.name'].browse(self._context.get('active_id'))

    for variable in class_obj:

        rec['wizard_field'] = variable.class_field


Hope this will helps you.

Thanks,


아바타
취소
관련 게시물 답글 화면 활동
2
8월 19
12700
2
2월 22
5507
3
2월 24
11595
2
9월 15
4583
0
5월 15
3089