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
Create an account today to enjoy exclusive features and engage with our awesome community!
साइन अप करें| Related Posts | Replies | डेटा देखने का तरीका | ऐक्टिविटी | |
|---|---|---|---|---|
|
2
अप्रैल 21
|
6522 | |||
|
0
मई 23
|
5195 | |||
|
1
जन॰ 23
|
10200 | |||
|
2
जन॰ 23
|
7820 | |||
|
0
फ़र॰ 21
|
5455 |
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