Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
746 Ansichten

Hello,

I am new to Odoo ... I have to receive data via MQTT and then write them into database. MQQT part works. I use on_message callback to receive data. I also have to check if some keys are present in the database and if they present, to store received data. 

However, trying to execute operators like this

work_order = env['mrp.workorder'].search([('id', '=', widint)])

I receive 

psycopg2.InterfaceError: Cursor already closed

I realize that I have no access to the database some way... My questions are how to open/connect to database to do execute above search and eventually writing some data into the database. on_message() function is called by paho-mqtt module in separate thread.


Ivan






Avatar
Verwerfen