A Scheduler helps to identify the necessary task,
assigns a logical sequence to these tasks and monitor their execution. The main
purpose of Scheduler is to identify tasks are on time.
There
are two ways to create scheduler in ERP
a. Functionally
a.
Creating Scheduler Functionally
Firstly simply go to Settings ->
scheduler -> scheduler_action.
Now
create new Scheduler here give value in interval number and interval unit on
Information page.
-
On Technical Data page write object name in
Object field and method name (which you want to call after an interval of
time) in Method field.
2. Save the record.
b. Creating
Scheduler Technically
Simply write it in .xml (view file)
<record id="ir_cron_mail_gateway_action"
model="ir.cron">
<field name="name">Fetchmail JKP</field>
<field name="interval_number">3</field>
<field name="interval_type">minutes</field>
<field name="numbercall">-1</field>
<field name="doall" eval="False"/>
<field name="model">mail.compose.message</field>
<field name="function">send_script_mail</field>
<field name="args">()</field>
</record>
Description of used terms:
"scheduler_id" : is a unique xml record id
"scheduler_name" : any desirable name
"active" : True or False determines
whether the scheduler is active or not..
"user_id" : refers the user who owns the
scheduler
"interval_number" : number of times the scheduler is to
be called based on the "interval_type"
"interval_type" : it can be days, hours, minutes etc
"numbercall" : Number of time the function is
called. negative number indicates no limit
"doall" : booelan field. A 'True' enables it to
execute missed occurrences as soon as the server is restarts
"model" : Name of object whose function
will be called when this scheduler will run. e.g. 'res.partner'
"function" : Name of the method to be called on
the object when this scheduler is executed.
"args" : Arguments to be passed to the method.
e.g. (uid,)
Thanks