mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
update izi and common misc
This commit is contained in:
@@ -23,7 +23,7 @@ def app_relaxng(view_type):
|
||||
relaxng_doc = etree.parse(frng)
|
||||
_relaxng_cache[view_type] = etree.RelaxNG(relaxng_doc)
|
||||
except Exception:
|
||||
_logger.error('Failed to load RelaxNG XML schema for views validation')
|
||||
_logger.error('You can Ignore this. Failed to load RelaxNG XML schema for views validation')
|
||||
_relaxng_cache[view_type] = None
|
||||
return _relaxng_cache[view_type]
|
||||
|
||||
|
||||
@@ -11,6 +11,13 @@ class MailMail(models.Model):
|
||||
# 猴子补丁模式,改默认发邮件逻辑
|
||||
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('@odooai.cn') != -1 or m.email_to.find('@odooapp.cn') != -1):
|
||||
email_to = m.email_to
|
||||
# 忽略掉无效email,避免被ban
|
||||
if email_to.find('no-reply@odooai.cn') != -1 or email_to.find('postmaster-odoo@odooai.cn') != -1:
|
||||
pass
|
||||
elif email_to.find('example.com') != -1 or email_to.find('@sunpop.cn') != -1 or email_to.find('@odooapp.cn') != -1:
|
||||
_logger.error(_("=================Email to ignore: %s") % email_to)
|
||||
self = self - m
|
||||
if not self:
|
||||
return True
|
||||
return super(MailMail, self)._send(auto_commit, raise_exception, smtp_session)
|
||||
|
||||
Reference in New Issue
Block a user