Ir al contenido
Menú
Se marcó esta pregunta

This is my new scheduled action: https://pastebin.com/78KnL19w

and this is my function:

class HrPayslip(models.Model):    

    _inherit = "hr.payslip"

    def action_test_function(self):   ... 


if i run the action manually it works correctly, but it never runs by itself, i think i'm missing a small detail but i really can't understand, if someone cuold help me i'd appreciate


thanks in advance

Avatar
Descartar
Mejor respuesta

Hello Cristian Carbone,

Please find code in comment.

I hope it will help you.

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

Avatar
Descartar

Please find below code it may help you to resolve this issue,
<?xml version="1.0" encoding="UTF-8"?>

<odoo>
<data noupdate="1">
<record id="auto_rilpre_generation_scheduler" model="ir.cron">
<field name="name">Rilpre Track: Auto Generation</field>
<field name="model_id" ref="model_hr_payslip"/>
<field name="state">code</field>
<field name="code">model.action_test_function()</field>
<field name="user_id" ref="base.user_admin"/>
<field name='interval_number'>2</field>
<field name='interval_type'>minutes</field>
<field name="numbercall">-1</field>
<field name="doall" eval="False"/>
</record>
</data>
</odoo>

Autor

code works on the community version but not on Sh; thank you for the effort!

Mejor respuesta

Remove ="function"eval="'action_test_function'"/> from your XML code. Try after that.

Avatar
Descartar
Autor

thanks Pratyush, but i already tried, and still nothing

Mejor respuesta

Hi,

Can you try add the following line of code too into your scheduled action

<field name="user_id" ref="base.user_root"/>


Regards 

Avatar
Descartar
Autor

hi, thanks for the effort, but it's not working, i really cannot understand what i'm missing

Hi,
Can you mention the code of action_test_function, which you are trying to run using scheduled action.

Autor

hi, the function was actually empty, my problem was that any of the scheduled actions on the database started

I was working on odoo.sh and I think it was a problem of multiple branches as I saw looking around in this forum

Publicaciones relacionadas Respuestas Vistas Actividad
1
mar 24
1976
0
nov 23
1465
1
dic 21
14122
6
abr 15
14825
2
mar 23
2474