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

tldr; We are trying to dynamically generate the onchange request fields. Not sure where to lookup the data.


We are currently calling onchange through XMLRPC to get default values for certain models (e.g. sale.order). However, the only way I've figured out how to get the default fields for the args parameter is to grab them out of a sample request in the web client in chrome (through developer tools). 

https://.../web/dataset/call_kw/sale.order/onchange

{active: "",all_qty_delivered:"",amount_untaxed:"1",analytic_account_id: "",...}

This is not sustainable as we add more fields or upgrade our odoo version. We need a way to do this per call instead of hardcoding.


It looks as if the web client is somehow building the field list through javascript. I tried debugging the js to figure it out but the js is...intense (obfuscated and deep). I couldn't find the correlation between what the web client is generating and all the field metadata in the code or database.


Any ideas on how to request or build this list through whatever is available through XMLRPC calls? For example ir.models? 


Thank you so much

Аватар
Отменить
Лучший ответ

Hi, please check this: https://youtu.be/Cmbo2iGuTBY 
Hope it helps.

Аватар
Отменить
Related Posts Ответы Просмотры Активность
3
июл. 25
2697
1
мая 25
996
0
нояб. 24
1258
2
окт. 24
1237
1
окт. 24
1931