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

Hello everyone, I try to get data when click an element. When I get result from RPC I need (if else) base on the result, here is my code 


and my debug console


Please give me some solutions , Thanks

아바타
취소

see this :

https://www.cybrosys.com/blog/call-json-rpc-to-web-controller-in-odoo

베스트 답변

Hi,

Try like following

this._rpc({
model: this.fields[this.parent_name].relation,
method: 'search_read',
domain: [[this.parents_name, '=', recordId.id]],
fields: ['id', 'name'],
sort: "",
}).then((result) => {
if(result.length) {
// do somthing
} else {
// do somthing else
}
})

Regards

아바타
취소
관련 게시물 답글 화면 활동
2
4월 21
4439
0
5월 23
3239
1
1월 23
8033
2
1월 23
5326
0
2월 21
3491