Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
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.
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"?> <openerp> <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"/> </record> </data> </openerp>
Dont forget to import the xml file in __openerp__.py
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.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 4/15/14, 4:37 AM|
|Seen: 1813 times|
|Last updated: 3/16/15, 8:10 AM|