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 |
|
|
|
known_third_party=requests,simplejson |
|
|
@ -1,9 +1,10 @@ |
|
|
|
# Copyright 2017 mikaelh <https://github.com/mikaelh> |
|
|
|
# Copyright 2017-2019 Ivan Yelizariev <https://it-projects.info/team/yelizariev> |
|
|
|
# License LGPL-3.0 (https://www.gnu.org/licenses/lgpl.html) |
|
|
|
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, |
|
|
|
|
|
@ -428,9 +428,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: |
|
|
@ -462,9 +460,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() |
|
|
@ -518,8 +514,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__) |
|
|
|