Odoo Help

Welcome!

This community 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.

0

Automatic message concept is working Database but not view in Form View

By
sridhar
on 12/7/13, 9:19 AM 438 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.

0

Serpent Consulting Services Pvt. Ltd.

--Serpent Consulting Services Pvt. Ltd.--
4341
| 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 8/5/15, 7:52 AM

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.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 12/7/13, 9:19 AM
Seen: 438 times
Last updated: 8/5/15, 7:52 AM