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
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
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
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng ký| Bài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
|---|---|---|---|---|
|
2
thg 4 21
|
6491 | |||
|
0
thg 5 23
|
5164 | |||
|
1
thg 1 23
|
10164 | |||
|
2
thg 1 23
|
7798 | |||
|
0
thg 2 21
|
5437 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.
see this :
https://www.cybrosys.com/blog/call-json-rpc-to-web-controller-in-odoo