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 ?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- ลูกค้าสัมพันธ์
- e-Commerce
- ระบบบัญชี
- สินค้าคงคลัง
- PoS
- Project
- MRP
คำถามนี้ถูกตั้งค่าสถานะ
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.
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อRelated Posts | ตอบกลับ | มุมมอง | กิจกรรม | |
---|---|---|---|---|
|
1
ธ.ค. 24
|
964 | ||
|
1
มี.ค. 15
|
6178 | ||
|
1
ธ.ค. 24
|
1385 | ||
Database for my module not created
แก้ไขแล้ว
|
|
4
เม.ย. 24
|
2191 | |
|
3
พ.ค. 22
|
15758 |
Check this: http://learnopenerp.blogspot.com/2019/10/connecting-to-odoo-using-xml-rpc.html
I am not using Odoo XML-RPC. I am accessing an external service from odoo.