コンテンツへスキップ
メニュー
この質問にフラグが付けられました
5 返信
6141 ビュー

I have a module synchronizing odoo with an external webservice. When the service sends hooks to odoo to signal an external modification, Odoo fails since it can’t figure out in which database to work, when there are several created or when none is set by default in configuration. So is there a python way to tell odoo in which database to work ?

アバター
破棄
著作者

I am not using Odoo XML-RPC. I am accessing an external service from odoo.

著作者 最善の回答

It is possible to set a database within odoo by accessing the session attribute of the WebRequest object. Let’s say you have a WebRequest object, named request:

request.session.db = 'db_name'
This can be used to dynamically set a database to a request received from an external webservice.
アバター
破棄
最善の回答

Not python, but in your webservice you must set a explicit database, you should read the Odoo API reference:


\https://www.odoo.com/documentation/13.0/webservices/odoo.html

アバター
破棄
著作者

It is a proprietary webservice I don’t own myself, so I can’t do anything on it.

関連投稿 返信 ビュー 活動
1
12月 24
972
1
3月 15
6189
1
12月 24
1400
4
4月 24
2217
3
5月 22
15780