Hi!
I have my Python code which want to use in automated action. I can't use it directly because import is prohibited:
forbidden opcode(s) in ... IMPORT_NAMEI can create a module and publish it on GitHib to get our Odoo.sh updated, then install it, but then I stucked again with same problem: i can't use "import" command in action script.
What am I doing wrong? How to create automated action in a way allow to use my python code?
(my use case is very simple: when data changed in monitored model, in Automated Action, OnCreateOrUpdate, I must call my REST API endpoint (doing that by using "import requests") and passing there details of changed data).
Please give me an advice, I'm fully locked between closed doors, looking forward for any hint!
Hi - can you please add the code too? It is hard to help/debug without the code.
Hello,
I tried to apply the monkey patch in question because I'm currently learning Odoo and I might need to write more complex code with Python imports in Automation Rules.
However, this monkey patch doesn't seem to work for me. I'm using Odoo 18 with odoo.sh.
Is there any change in the code for Odoo 18?
Thanks :)