最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - Do Odoo webhooks work in Odoo on-premise? - Stack Overflow

programmeradmin0浏览0评论

I have an instance of Odoo in SH and with it I created webhooks and automated quite a few processes. Now I am trying to do the same with an on-premise Odoo instance installed on a non-Odoo server.

First I tried something simple like this:

import requests
import json

URL = "server-url"

headers = {"Content-Type": "application/json"}

payload = {
    "name": "Registro usando webhook y python",
    "email_from": "[email protected]",
    "phone": "32733888",
    "partner_id": 2,
    "user_id": 2,
}

json_data = json.dumps(payload)

response = requests.post(URL, headers=headers, data=json_data)

print(response.status_code)
print(response.text)

But I get this error:

404
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>404 Not Found</title>
<h1>Not Found</h1>
<p>The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.</p>

Obviously the url I am sending is not the one I put in the example, it is just for security.

发布评论

评论列表(0)

  1. 暂无评论