Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
2 Vastaukset
4439 Näkymät

Hi All,

I'm trying to put a simple scheduled task to work on .sh and SaaS.

Name: Test
Model : Contact
User : Myself
Execute every 1 minutes
Active : yes
Number of Calls -1
priority 1

Code =  log("test")

It seems it only runs when I click Run manually.

Why don't I get a log message every 1 minute ? 
Is there something I need to activate or any other setting I have to do to make it work ? 


Sincerly
Kristof


Avatar
Hylkää
Tekijä

Thank you for the information.




Although I have one with a 15 min Delay too, which doesnt run either. I testers this on 2 SaaS and 1 .sh so I think i'm missing something . Are there any settings I could look out for which can cause this ?

Paras vastaus

Hi,

To create a scheduled action that runs every 1 minutes and is always active, you can modify the code as follows

<?xmlversion="1.0" encoding="UTF-8" ?>

<odoo>

    <data>

        <recordid="ir_cron_time_token" model="ir.cron">

            <fieldname="name">Test : </field>

            <fieldname="model_id" ref="model_res_partner"/>

            <fieldname="state">code</field>

            <fieldname="code">model.function_test()</field>

            <fieldname="interval_number">1</field>

            <fieldname="interval_type">minutes</field>

            <fieldname="numbercall">-1</field>

            <fieldname="active">True</field>

        </record>

    </data>

</odoo>




And write your function in python file of corresponding model

def function_test():

      #your code

Refer below blog to know more on scheduled action:

Scheduled Actions in Odoo 14


Hope it helps

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
1
elok. 23
1849
3
lokak. 22
10239
2
heinäk. 22
11278
0
marrask. 21
1510
1
syysk. 21
4070