Odoo Help

0

How to implement spool concept in odoo frame work

By
joshi
on 7/8/15, 1:23 AM 645 views

Hi, i have implemented email functionality for modules when event is triggered, right now am trying to push mails to mails pool , after that i need to send mails from spool , is there any concept of pushing mails to spool in odoo framework ??, can any one tell me where can i find it 

0
Axel Mendoza
On 7/10/15, 2:38 AM

You can create mail.message without sending, also you could marked with some field as a tag, then using a cron action you could send those emails in a disconected way using your conditions, etc

HI Axel Thanks for response, i got this by mail_values={ 'email_from': employeeEmail, 'email_to': employeeEmail, 'subject': 'Leave Status', 'body_html': 'HI %s'% employeeName +'


Leave Type: %s' % statusName + '


No.of days: %s'%record.number_of_days_temp+'


The status of the leave you''ve applied for the period %s'% record.date_from+'TO %s' %record.date_to +'has been changed to %s'% record.state , 'auto_delete': True, 'type': 'email', } mail_obj = self.pool.get('mail.mail') msg_id = mail_obj.create(cr, uid,mail_values, context=context) msg_obj = self.pool.get('mail.message') msg_obj.create(cr, uid, mail_values)

joshi
on 7/10/15, 4:43 AM

You do not need the mail.mail create just the message, then create a cron definition to check for those messages not delivered and use a mail.mail create with values {'mail_message_id': mail_message_id} and call the method send on mail.mail to deliver the mail.message

Axel Mendoza
on 7/10/15, 5:29 AM
0
joshi
On 7/10/15, 4:45 AM

HI Axel Thanks for response,

i got this by

mail_values={

'email_from': employeeEmail,

'email_to': employeeEmail,

'subject': 'Leave Status',

'body_html': 'HI %s'% employeeName +'

Leave Type: %s' % statusName + '

No.of days: %s'%record.number_of_days_temp+'

The status of the leave you''ve applied for the period %s'% record.date_from+'TO %s' %record.date_to +'has been changed to %s'% record.state , 'auto_delete': True, 'type': 'email', }

mail_obj = self.pool.get('mail.mail')

msg_id = mail_obj.create(cr, uid,mail_values, context=context)

msg_obj = self.pool.get('mail.message')

msg_obj.create(cr, uid, mail_values)

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

Question tools

2 follower(s)

Stats

Asked: 7/8/15, 1:23 AM
Seen: 645 times
Last updated: 10/17/15, 4:46 AM