简体   繁体   English

通过 API Odoo 发送 email 请求签名

[英]Send email for sign request via API Odoo

To consume the Odoo API (XML/RPC) in Python, you code the way you send odoo the model, then the method in the model and finally the arguments to the method:要在 Python 中使用 Odoo API (XML/RPC),您需要编写发送 odoo model 的方式,然后是 model 中的方法,最后是 arguments 到方法:

api.execute_kw(database, uid, api_key, "model", "method", method_args)

It results executing something like this on server side:结果在服务器端执行类似这样的事情:

model.method(1234)

I'm making a Python client to send document sign requests via email To get the calls I enabled debug mode in the conf file, recreate the steps to upload a document, and then send the email;我正在制作一个 Python 客户端,通过 email 发送文档签名请求 为了获得调用,我在 conf 文件中启用了调试模式,重新创建上传文档的步骤,然后发送 email; finally implement the appropiate calls in my client.最终在我的客户中实施适当的调用。

Now, from my Python client, I can upload the pdf document and create the email message, my issue is trying to tell Odoo to send the message.现在,从我的 Python 客户端,我可以上传 pdf 文档并创建 email 消息,我的问题是试图告诉 Odoo 发送消息。

Odoo has its own API client to this, watching the log when send the email, I got this: Odoo 有自己的 API 客户端,发送 email 时查看日志,我得到了这个:

DEBUG odoo_data odoo.api: call sign.send.request(1234,).send_request()

The structure of coe here changes这里coe的结构发生变化

ir.model(1234,).method()

The argument '1234' is sent to the Object at instantiate time.参数“1234”在实例化时发送到 Object。

How can implement this code with my API client:如何用我的 API 客户端实现此代码:

I tried to use normally and it works, there's no special treatment with that.我尝试正常使用并且它有效,没有特殊处理。

api.execute_kw(database,uid,api_key, "sign.send.request","send_request",[1234])

In my case, when use the method 'send_request', the Odoo server log shows this:在我的例子中,当使用“send_request”方法时,Odoo 服务器日志显示如下:

DEBUG odoo_data odoo.api: call sign.send.request(1234,).send_request()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM