Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
5053 มุมมอง

Hi everyone,

I am looking for a way to call a method (preferably an @api.model method but other ways are possible too) automatically after every Odoo startup. I need to establish a connection to an external service whenever Odoo starts but am not sure how to go about it. 


Things I tried unsuccessfully:

- using a post_init_hook: not possible because it is only called on module updates/installation despite the name

- using a post_load hook: undocumented so I would like to avoid that one but it also does not get the cr or env passed so I am not sure if it is even possible to access it from there

- running stuff directly from the module __init__.py: does run everytime but also has no access (as far as I can tell) to the env yet


Is there a mechanism in Odoo to call stuff inside the current env (as superuser) after a Odoo started?


Thanks in advance and have a great day
Eric

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
มิ.ย. 21
4283
2
ม.ค. 24
1419
2
ก.พ. 23
3371
0
ต.ค. 21
3882
First steps in Odoo แก้ไขแล้ว
7
ก.พ. 25
7117