Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
5 Răspunsuri
6168 Vizualizări

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 ?

Imagine profil
Abandonează
Autor

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

Autor Cel mai bun răspuns

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.
Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează
Autor

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

Related Posts Răspunsuri Vizualizări Activitate
1
dec. 24
1009
1
mar. 15
6214
1
dec. 24
1435
4
apr. 24
2263
3
mai 22
15835