mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
17 lines
607 B
Python
17 lines
607 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
from odoo import api, fields, models, _
|
|
|
|
import logging
|
|
_logger = logging.getLogger(__name__)
|
|
|
|
class MailMail(models.Model):
|
|
_inherit = "mail.mail"
|
|
|
|
# 猴子补丁模式,改默认发邮件逻辑
|
|
def _send(self, auto_commit=False, raise_exception=False, smtp_session=None):
|
|
for m in self:
|
|
if m.email_to and (m.email_to.find('example.com') != -1 or m.email_to.find('@sunpop.cn') != -1 or m.email_to.find('@odooapp.cn') != -1):
|
|
self = self - m
|
|
return super(MailMail, self)._send(auto_commit, raise_exception, smtp_session)
|