Skip to Content
Menu
This question has been flagged
1 Reply
2174 Views

Hi, I want to create auto message concept in OpenERP 7, I put my code in scheduler, it is running but values store in Database but I can't view in form view, where i missed in this code, Here is my code.

 def search_for_end_service(self, cr, uid, context=None):        
        if context is None:
            context={}
        call_obj=self.pool.get('hr.employee')       
        currentdate=time.strftime('%Y-%m-%d')
        current_date=datetime.strptime(currentdate,'%Y-%m-%d')
        diff=timedelta(days=0)        
        exp_date=current_date+diff        
        ids=call_obj.search(cr, uid, [('visa_exp_card','=',exp_date)])        
        if ids:
            for p_id in ids:
                line=call_obj.browse(cr, uid, p_id)
                expired_products=line.name                    
            message=_('The Following Products services should be done within tomorrow.\n\n Products:%s \n\n')%(expired_products,),
            self.pool.get('mail.compose.message').create(cr, uid, {
                'name':_('Products to be serviced Today'),
                'body':message,
                'act_from':uid,
                'act_to':uid,})
        return True

In cron i use this .XML

<record forcecreate="True" id="ir_service_products_info" model="ir.cron">
        <field name="name">Visa ExpiryServices Alert</field>
        <field name="active" eval="True"/>
        <field name="user_id" ref="base.user_root"/>
        <field name="interval_number">1</field>
        <field name="interval_type">minutes</field>
        <field name="numbercall">-1</field>
        <field name="doall" eval="False"/>
        <field name="model" eval="'hr.employee'"/>
        <field name="function" eval="'search_for_end_service'"/>
        <field name="args" eval="'(False,)'"/>
    </record>

How to solve this problem.

Avatar
Discard
Best Answer

Shridhar,

Please check if the popup reminder helps you on this.

Here is the module : https://www.odoo.com/apps/modules/8.0/popup_reminder

Thanks.

Avatar
Discard
Related Posts Replies Views Activity
2
Mar 15
4169
1
Mar 15
3604
1
Mar 15
3234
1
Mar 15
7674
2
Apr 21
15970