Ivan Yelizariev
5 years ago
No known key found for this signature in database
GPG Key ID: 93F14FB6A8B57057
5 changed files with
11 additions and
12 deletions
-
.isort.cfg
-
mail_base/controllers/main.py
-
mail_fix_553/mail_fix_553.py
-
mail_move_message/mail_move_message_models.py
-
mailgun/models/ir_config_parameter.py
|
|
@ -9,4 +9,4 @@ line_length=88 |
|
|
|
known_odoo=odoo |
|
|
|
known_odoo_addons=odoo.addons |
|
|
|
sections=FUTURE,STDLIB,THIRDPARTY,ODOO,ODOO_ADDONS,FIRSTPARTY,LOCALFOLDER |
|
|
|
known_third_party=openerp,requests,simplejson,werkzeug |
|
|
|
known_third_party=requests,simplejson,werkzeug |
|
|
@ -1,6 +1,7 @@ |
|
|
|
from odoo.addons.bus.controllers.main import BusController |
|
|
|
from odoo.http import request |
|
|
|
|
|
|
|
from odoo.addons.bus.controllers.main import BusController |
|
|
|
|
|
|
|
|
|
|
|
class MailChatController(BusController): |
|
|
|
# ----------------------------- |
|
|
|
|
|
@ -4,11 +4,12 @@ import re |
|
|
|
from email.utils import formataddr |
|
|
|
|
|
|
|
from odoo import SUPERUSER_ID, tools |
|
|
|
from odoo.addons.base.ir.ir_mail_server import MailDeliveryException |
|
|
|
from odoo.osv import osv |
|
|
|
from odoo.tools.safe_eval import safe_eval as eval |
|
|
|
from odoo.tools.translate import _ |
|
|
|
|
|
|
|
from odoo.addons.base.ir.ir_mail_server import MailDeliveryException |
|
|
|
|
|
|
|
_logger = logging.getLogger(__name__) |
|
|
|
|
|
|
|
|
|
|
@ -146,7 +147,8 @@ class MailMail(osv.Model): |
|
|
|
attachments=attachments, |
|
|
|
message_id=mail.message_id, |
|
|
|
references=mail.references, |
|
|
|
object_id=mail.res_id and ("{}-{}".format(mail.res_id, mail.model)), |
|
|
|
object_id=mail.res_id |
|
|
|
and ("{}-{}".format(mail.res_id, mail.model)), |
|
|
|
subtype="html", |
|
|
|
subtype_alternative="plain", |
|
|
|
headers=headers, |
|
|
|
|
|
@ -429,9 +429,7 @@ class MailMessage(models.Model): |
|
|
|
# building message tree |
|
|
|
return |
|
|
|
if not self.author_id: |
|
|
|
self.write( |
|
|
|
{"author_id": author.id} |
|
|
|
) |
|
|
|
self.write({"author_id": author.id}) |
|
|
|
|
|
|
|
vals = {} |
|
|
|
if move_back: |
|
|
@ -463,9 +461,7 @@ class MailMessage(models.Model): |
|
|
|
"res_partner_id": self.env.user.partner_id.id, |
|
|
|
"is_read": False, |
|
|
|
} |
|
|
|
self.write( |
|
|
|
{"notification_ids": [(0, 0, notification)]} |
|
|
|
) |
|
|
|
self.write({"notification_ids": [(0, 0, notification)]}) |
|
|
|
|
|
|
|
for r in self.all_child_ids: |
|
|
|
r_vals = vals.copy() |
|
|
@ -519,8 +515,7 @@ class MailMessage(models.Model): |
|
|
|
for record in reads: |
|
|
|
name = record["record_name"] or "" |
|
|
|
extended_name = " [{}] ID {}".format( |
|
|
|
record.get("model", "UNDEF"), |
|
|
|
record.get("res_id", "UNDEF"), |
|
|
|
record.get("model", "UNDEF"), record.get("res_id", "UNDEF"), |
|
|
|
) |
|
|
|
res.append((record["id"], name + extended_name)) |
|
|
|
return res |
|
|
|
|
|
@ -2,6 +2,7 @@ import logging |
|
|
|
|
|
|
|
import requests |
|
|
|
import simplejson |
|
|
|
|
|
|
|
from odoo import api, models |
|
|
|
|
|
|
|
_logger = logging.getLogger(__name__) |
|
|
|