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

Hello,

I have on_change function in a wizard ... I'm trying to get the context variable such as 'active_id' or pass new variables from the xml, but it always shows me empty context .

is there any way to get active_id of the parent form in my on_change method ..

thanks ...

아바타
취소

active_id is passed when a wizard is called from a button or short cut Menu. How are you calling your wizard?

post your code here, to get better idea

베스트 답변

Hello Ahmed M.Elmubarak,

Usually, if you want to access the current value of context, you have to add the variable : context, in your xml view, for example : 

<field name"=your_field" on_change="your_onchange_method(field1, field2, context)"/>

Assuming that field1 and field2 are present in your model AND in your current view (as it supplies the current value of those fields, eventually modified by the user, not their actual stored value in db). 

Finally, your method may have the following signature to be usable: 

def your_onchange_method(self, cr, uid, ids, field1, field2, context): 

    # ids has no value, but has to be present

 

Hope it helps you,

Regards

아바타
취소
작성자

Thanks mate , yes this passed the context ...

관련 게시물 답글 화면 활동
0
8월 17
3342
0
3월 15
4372
2
3월 15
4142
1
2월 24
2952
1
4월 21
12916