콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다

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
983
1
3월 15
6197
1
12월 24
1402
4
4월 24
2229
3
5월 22
15793