跳至内容
菜单
此问题已终结

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
3923
0
5月 23
2611
1
1月 23
7368
2
1月 23
4766
0
2月 21
3104