Skip to Content
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
7234 Представления

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

Аватар
Отменить
Related Posts Ответы Просмотры Активность
2
апр. 21
3822
0
мая 23
2519
1
янв. 23
7250
2
янв. 23
4685
0
февр. 21
3005