İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
7984 Görünümler

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

Avatar
Vazgeç

see this :

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

En İyi Yanıt

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

Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
2
Nis 21
4476
0
May 23
3274
1
Oca 23
8051
2
Oca 23
5362
0
Şub 21
3521