コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
7855 ビュー

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

アバター
破棄

see this :

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

最善の回答

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

アバター
破棄
関連投稿 返信 ビュー 活動
2
4月 21
4349
0
5月 23
3133
1
1月 23
7943
2
1月 23
5253
0
2月 21
3386