Browse Source

[FIX] import re

pull/1/head
Ivan Yelizariev 10 years ago
parent
commit
a3ea6113cb
  1. 9
      mail_fix_553.py

9
mail_fix_553.py

@ -14,6 +14,8 @@ from openerp.tools.translate import _
_logger = logging.getLogger(__name__) _logger = logging.getLogger(__name__)
import re
class mail_mail(osv.Model): class mail_mail(osv.Model):
_inherit = "mail.mail" _inherit = "mail.mail"
@ -160,10 +162,3 @@ class mail_mail(osv.Model):
if auto_commit is True: if auto_commit is True:
cr.commit() cr.commit()
return True return True
for mail in self.browse(cr, SUPERUSER_ID, ids, context=context):
email_from = mail.email_from
if not email_from or re.search(correct_email_from, email_from) is None:
mail.write({'email_from': default_email_from})
return super(mail_mail, self).send(cr, uid, ids, context=context, **kwargs)
Loading…
Cancel
Save