Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
here i want to check a lead type is 'lead' or 'opportunity' , and type is lead means send a mail,
here is my code,
def _check_lead(self, cr, uid, ids, fields, args, context=None):
for lead in self.browse(cr, uid, ids):
if lead.type == 'lead':
sender = 'email@example.com'
receivers = ['firstname.lastname@example.org']
message = """From: Administrator Test <email@example.com>
To: To Person <firstname.lastname@example.org>
Subject: SMTP e-mail test
This is a test e-mail message.
smtpObj = smtplib.SMTP('mail.demo.com',25)
smtpObj.sendmail(sender, receivers, message)
raise osv.except_osv(('Your mail was not send, because the Server connection was problem.'))
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
|Asked: 5/26/14, 2:00 AM|
|Seen: 1091 times|
|Last updated: 3/16/15, 8:10 AM|