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.