Odoo Help


How to enable scheduler in openerp 7?

on 4/15/14, 4:37 AM 2,184 views

I have been working to enable scheduler to call a particular function which will send alerts to the users of current forms. I am enabling this feature through settings->Technical->Scheduler->Scheduled Actions , but still my function is not called . I tried this to another simple function but no success. I am not sure where I am doing wrong. Please help me to fix this.



Dhinesh - Technical Consultant, Sodexis Inc

--Dhinesh - Technical Consultant, Sodexis Inc--
| 5 4 9
Pondicherry, India
--Dhinesh - Technical Consultant, Sodexis Inc--

Passionate coder in Python/OpenERP. Knows Django/Flask MVC frameworks. Did code in Java, PHP.

Contact me at: dvdhinesh.mail@gmail.com

Dhinesh - Technical Consultant, Sodexis Inc
On 4/15/14, 5:14 AM

Hi you can create a function in your py file and call the function in _data.xml which will run your scheduler.


Import the following in your py file:

import logging
from datetime import datetime
 _logger = logging.getLogger(__name__)

Create a function

def test_scheduler(self,cr,uid,ids=None,context=None):
    _logger.info("Scheduler Testing"+str(datetime.today()))
    return True

Create a yourmodule_data.xml file

<?xml version="1.0" encoding="utf-8"?>
    <data noupdate="1">
        <record id="ir_cron_scheduler" model="ir.cron">
            <field name="name">Test Scheduler</field>
            <field name="interval_number">2</field>
            <field name="interval_type">minutes</field>
            <field name="numbercall">-1</field>
            <field eval="False" name="doall"/>
            <field eval="'yourmodelname'" name="model"/>
            <field eval="'test_scheduler'" name="function"/>
            <field eval="'()'" name="args"/>

Dont forget to import the xml file in __openerp__.py


is this mandatory to use _logger = logging.getLogger(__name__) because I will no longer be using it

on 4/15/14, 5:39 AM

No. For this example i want the output to be printed on console log. So i imported tht. It depends on your need.

Dhinesh - Technical Consultant, Sodexis Inc
on 4/15/14, 6:06 AM

no its still not working . have u tried it at your application ? because I m not getting anything on console

on 4/15/14, 6:15 AM

Ya its working fine with me. Did u get the scheduler name in web client?? U can verify that by Settings->Technical->Scheduler->Scheduled Actions, where u can find the scheduler name which was given in xml file.

Dhinesh - Technical Consultant, Sodexis Inc
on 4/15/14, 7:35 AM

yes it worked . thanks I was making a big mistake

on 4/15/14, 8:08 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 4/15/14, 4:37 AM
Seen: 2184 times
Last updated: 3/16/15, 8:10 AM