Skip to Content
Menu
This question has been flagged

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
Discard
Best Answer

Hello Cristian Carbone,

Please find code in comment.

I hope it will help you.

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

Avatar
Discard

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>

Author

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

Best Answer

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

Avatar
Discard
Author

thanks Pratyush, but i already tried, and still nothing

Best Answer

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
Discard
Author

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.

Author

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

Related Posts Replies Views Activity
1
Mar 24
761
0
Nov 23
355
1
Dec 21
12102
6
Apr 15
13861
2
Mar 23
1430