Odoo Help

0

How to create odoo email template for "pending" wizard case ..?

By
Manish Bohra
on 8/29/17, 5:30 AM 324 views

hello , i have to try create email template for pending case.

for Example :  when i am assign a issue into pending  case than issue is updated pending in form view  as well as in tree view but when i have  receive in that show old issue ticket so can you help me how to get current pending ticket in email.

my pending case code show below : 

def pending_case(self, cr, uid, ids, context=None):
example_obj = self.pool.get('example.helpdesk')
record_id = context.get('active_id')
data = self.read(cr, uid, ids)[0]
print data
xyz = data['pending_reason']
print example_obj.write(cr, uid, [record_id], {'pending_reson': xyz, 'state': 'pending'})
example_obj.write(cr, uid, [record_id], {'pending_reson': xyz, 'state': 'pending'})

try:
template_id = self.pool.get('email.template').search(cr, uid, [("name", "=", "HelpDesk:Pending")])
print "template_id", template_id
if template_id:
print "rllllll", template_id, ids[0]
mail_message = self.pool.get('email.template').send_mail(cr, uid, template_id[0], ids[0])
print 'mail_message', mail_message
print 'tmp_id', template_id
except Exception, e:
print "Exception", e
return True

Issue solved ..

Manish Bohra
on 10/7/17, 7:10 AM

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

1 follower(s)

Stats

Asked: 8/29/17, 5:30 AM
Seen: 324 times
Last updated: 10/11/18, 1:20 PM