Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
7273 Vizualizări

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

Imagine profil
Abandonează

see this :

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

Cel mai bun răspuns

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

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
2
apr. 21
3841
0
mai 23
2551
1
ian. 23
7281
2
ian. 23
4717
0
feb. 21
3054