Skip to Content
Menu
This question has been flagged
2921 Views


I make à function in python , I need to run it every month , i try by munites , but no result


def onchange_right_leave(self,cr,uid,ids,right_leaves,remaining_leaves, context= None):
        date_now=datetime.now()       

        diff_day = date_now.day
        if right_leaves :
                result = {'value': {                            

                    'remaining_leaves' : remaining_leaves + right_leaves,    

                                 }                     }             

                 return result


<record id="ir_cron_scheduler_demo_action" model="ir.cron">           

<field name="name">Demo scheduler</field>                 

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

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

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

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

   <field name="doall" eval="False" />           

<field name="model" eval="'hr.employee'" />           

<field name="function" eval="'onchange_right_leave'" />        

   <field name="args" eval="'()'" />       

</record>



Avatar
Discard
Author

Hello , I work by the same link but no result , thank you