mirror of https://github.com/OCA/social.git
[FIX] mail_drop_target: new attribute name
The external dependency `extract_msg` changed how to access to the message id in [its 0.24.4 release][1]. That broke the branch. Fixing here. [1]: https://github.com/mattgwwalker/msg-extractor/releases/tag/v0.24.4 @Tecnativa TT24457pull/519/head
parent
72f55e01c8
commit
f7cfa9e13b
|
@ -81,6 +81,11 @@ class MailThread(models.AbstractModel):
|
||||||
_("Install the msg-extractor library to handle .msg files")
|
_("Install the msg-extractor library to handle .msg files")
|
||||||
)
|
)
|
||||||
message_msg = Message(b64decode(message))
|
message_msg = Message(b64decode(message))
|
||||||
|
try:
|
||||||
|
message_id = message_msg.messageId
|
||||||
|
except AttributeError:
|
||||||
|
# Using extract_msg < 0.24.4
|
||||||
|
message_id = message_msg.message_id
|
||||||
message_email = self.env["ir.mail_server"].build_email(
|
message_email = self.env["ir.mail_server"].build_email(
|
||||||
message_msg.sender,
|
message_msg.sender,
|
||||||
message_msg.to.split(","),
|
message_msg.to.split(","),
|
||||||
|
@ -89,7 +94,7 @@ class MailThread(models.AbstractModel):
|
||||||
message_msg._getStream("__substg1.0_10130102") or message_msg.body,
|
message_msg._getStream("__substg1.0_10130102") or message_msg.body,
|
||||||
email_cc=message_msg.cc,
|
email_cc=message_msg.cc,
|
||||||
headers={"date": message_msg.date},
|
headers={"date": message_msg.date},
|
||||||
message_id=message_msg.message_id,
|
message_id=message_id,
|
||||||
attachments=[
|
attachments=[
|
||||||
(attachment.longFilename, attachment.data)
|
(attachment.longFilename, attachment.data)
|
||||||
for attachment in message_msg.attachments
|
for attachment in message_msg.attachments
|
||||||
|
|
Loading…
Reference in New Issue