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
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
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
Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !
S'inscrire| Publications associées | Réponses | Vues | Activité | |
|---|---|---|---|---|
|
2
avr. 21
|
5365 | |||
|
0
mai 23
|
4157 | |||
|
1
janv. 23
|
8921 | |||
|
2
janv. 23
|
6500 | |||
|
0
févr. 21
|
4205 |
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