Odoo Help


want that when there is 2 days left in returning that asset so automatically employee gets alert through email how i can do this

on 1/8/14, 9:29 PM 1,501 views

hi i have my module in which i am allocating asset to employee and employee will return that asset in specific time duration, i want that when there is 2 days left in returning that asset so automatically employee gets alert through email how i can do this in open erp v 7


Gopakumar N G

--Gopakumar N G--
| 5 4 7
Cochin, India
--Gopakumar N G--

Project Lead at Bizweaver Technologies Pvt. Ltd.

Gopakumar N G
On 1/9/14, 12:54 AM

You can use schedulers to send the alert automatically. First create a scheduler in your module, name the file as scheduler_data.xml and add the following in it.

<?xml version="1.0" encoding="utf-8"?>
    <data noupdate="1">

        <record forcecreate="True" id="ir_cron_check_shipping_date" model="ir.cron">
            <field name="name">Asset Reminder</field>
            <field eval="True" name="active" />
            <field eval="False" name="doall" />
            <field name="user_id" ref="base.user_root" />
            <field name="interval_number">1</field>
            <field name="interval_type">days</field>
            <field name="numbercall">-1</field>
            <field eval="your.model.name'" name="model" />
            <field eval="'check_asset_date'" name="function" />
            <field eval="'(False,)'" name="args" />

In the above, in model field specify the model name (I have given it as your.model.name, replace it with your model name). You can configure the scheduler to execute depending on the intervals available, say days, months, weeks, hours, minutes etc in above code or client side. If you make any changes in client side, it will stay unchanged even if you upgrade the module, because noupdate="1" is set. Then define the email template for the email to be send, you can configure the template in client side or in xml code. Now you need to define the method check_asset_date in your model.

def check_asset_date(self, cr, uid, ids, context+None):
           # Your code to check date goest here
           # Then call the send_mail method of model email.template with desired parameters and you must pass
          # your email template's id by searching and finding the id of the template.
          return True
On 1/10/14, 3:46 AM

thanks alot but i have confusion that can i make it through interface of open erp v 7 because it has options of emial , server , scheduler . i have watched a video on youtube in which through automated action and scheduler he was sending email. but automated action is not showing in my open erp interface so kindly tell me wheather can i do it through interface or code is the only options

As far as I know: You can enter the code in the interface. Have you set the technical feature in your user rights?


on 1/10/14, 4:08 AM

yes i have enable technical feature but automated action is not showing in the options

on 1/12/14, 3:48 PM

Serpent Consulting Services Pvt. Ltd.

--Serpent Consulting Services Pvt. Ltd.--
| 6 6 8
Gandhinagar, India
--Serpent Consulting Services Pvt. Ltd.--

Serpent Consulting Services Pvt. Ltd. Your Odoo/OpenERP Solution, just an email away!

Serpent Consulting Services Pvt. Ltd.
On 1/9/14, 1:35 AM

Hello Bakhtawar,

You just need to write a method to check your condition of date.

In that method you need to create one email template regarding your mail body.

Call that method in scheduler.

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: 1/8/14, 9:29 PM
Seen: 1501 times
Last updated: 3/16/15, 8:10 AM