Skip to content Skip to sidebar Skip to footer

How To Pass Cron Id As Arg In Method That The Cron Calls

I have many crons that call the same method at different time and the method needs to find that which cron called it to find other record based on that cron. The args mustn't be fi

Solution 1:

Use ir.cron function and args fields:

<record id="ir_cron_send_customer_feedback_email_job" model="ir.cron">
    <field name="name">Send Feedback Email to customer</field>
    <field eval="False" name="active"/>
    <field name="user_id" ref="base.user_root"/>
    <field name="interval_number">4</field>
    <field name="interval_type">hours</field>
    <field name="numbercall">-1</field>
    <field eval="False" name="doall"/>
    <field eval="ref('customer_review_global_channel_ept.model_email_global_channel_rule_ept')" name="model_id" />
    <field name="function" eval="'send_feedback_email_cron'"/>
    <field name="args" eval="'(...your args...)'"/>
</record>

Post a Comment for "How To Pass Cron Id As Arg In Method That The Cron Calls"