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
أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!
تسجيلالمنشورات ذات الصلة | الردود | أدوات العرض | النشاط | |
---|---|---|---|---|
|
2
أبريل 21
|
3827 | ||
|
0
مايو 23
|
2529 | ||
|
1
يناير 23
|
7264 | ||
|
2
يناير 23
|
4693 | ||
|
0
فبراير 21
|
3014 |
see this :
https://www.cybrosys.com/blog/call-json-rpc-to-web-controller-in-odoo