Impacted versions: 13
Steps to reproduce:
create cronjob:
<record id="my id" model="ir.cron">
<field name="name">lol</field>
<field name="model_id" ref="my_app.model_my_model"/>
<field name="active" eval="False"/>
<field name="user_id" ref="base.user_root"/>
<field name="interval_number">1</field>
<field name="interval_type">days</field>
<field name="numbercall">-1</field>
<field name="state">code</field>
<field name="code">model.cron_blabla()</field>
<field name="nextcall">2010-01-01 02:00:00</field>
</record>
and my_model.py has :
@api.model
def cron_blabla(self):
running_jobs = self.env['some.model'].sudo().search([])
Current behavior:
No error in the log, but it doesn't do anything. The debugger can't
retrieve the self value thus i can't perform the typical
self.env['my.model'] and if i let it run i get an eternal odoo loading
screen.
"running_jobs = self.env['some.model'].sudo().search()" accessing self here, is for some reason a problem.
Expected behavior:
The function should run, self.env['xyz'] should work
Help is highly appreciated
Special Hint/Edit:
I found out that the method is crashing as soon as it enters the function. The content of the first line doesn't play a role on the outcome