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

Hi to all !


With the API documentation I clearly see how to create and update records on my DB using XML-RPC calls.

What I did not find in the API documentation is how to trigger a method...

So in my case I try to send by the XML-RPC API an email template I have created,
rather than going to the screen in Mailings and hit the "send" button.

Has anyone of you some example to share ?

Thanks for your support !


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

Hi Ray.

Just another tip I got which worked fine for me without accessing the server side : enabling "developers options" in Chrome and monitoring the network traffic. The functions calls appear in clear and so I can emulate them in the API calls.

Simple but effective. ;-)


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

Odoo can be configured to log all API calls, so you can do that and click "SEND" to see what Odoo API call is made and what the parameters are:


You configure the log file via either command line parameters or a configuration file.

https://www.odoo.com/documentation/14.0/reference/cmdline.html

https://www.odoo.com/documentation/14.0/reference/cmdline.html#configuration-file

In particular, the following options can instruct Odoo to provide the information you want:

--log-request

enable DEBUG logging for RPC requests, equivalent to --log-handler=odoo.http.rpc.request:DEBUG

--log-response

enable DEBUG logging for RPC responses, equivalent to --log-handler=odoo.http.rpc.response:DEBUG


You may also need to suppress other debug information.



Аватар
Отменить
Автор

Hi Ray.

Thanks a lot for the tip.
I do assume I can only use it on a Odoo instance located on a server where I have admin access.
In other words : could I (and how) use this on a Odoo instance hosted on Odoo.com ?
If not, I understand it is time for me to install an instance on a local computer. ;-)

All the best,

V.

While the API is the same irrespective of the hosting option, you will need access to the server to instruct the server to post the api call debug information to the log file (and to view the log file). Odoo.sh provides such access for example.