Skip to content

Commit ca06ad5

Browse files
Borrusomathiasfrancke
authored andcommitted
[MIG] mail_quoted_reply: Migration to 18.0
1 parent f1637d1 commit ca06ad5

File tree

5 files changed

+28
-38
lines changed

5 files changed

+28
-38
lines changed

mail_quoted_reply/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"name": "Mail Message Reply",
66
"summary": """
77
Make a reply using a message""",
8-
"version": "17.0.1.0.0",
8+
"version": "18.0.1.0.0",
99
"license": "AGPL-3",
1010
"author": "Creu Blanca,Odoo Community Association (OCA)",
1111
"website": "https://github.com/OCA/mail",
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
/* @odoo-module */
2-
31
import {messageActionsRegistry} from "@mail/core/common/message_actions";
42

53
messageActionsRegistry.add("reply", {
6-
icon: "fa-reply",
4+
icon: "fa fa-reply",
75
title: "Reply",
8-
onClick: (component) =>
9-
component.messageService.messageReply(component.props.message),
6+
onClick: (component) => component.message.messageReply(component.props.message),
107
condition: (component) => component.canReply,
118
});
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import {Message} from "@mail/core/common/message_model";
2+
import {patch} from "@web/core/utils/patch";
3+
4+
patch(Message.prototype, {
5+
async messageReply(message) {
6+
var self = this;
7+
const thread = message.thread;
8+
await this.store.env.services.orm
9+
.call("mail.message", "reply_message", [message.id])
10+
.then(function (result) {
11+
return self.store.env.services.action.doAction(result, {
12+
onClose: async () => {
13+
await self.store.env.services["mail.store"].Thread.getOrFetch(
14+
thread,
15+
["messages"]
16+
);
17+
self.store.env.bus.trigger("update-messages");
18+
},
19+
});
20+
});
21+
},
22+
});

mail_quoted_reply/static/src/message_patch.esm.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* @odoo-module */
2-
31
import {Message} from "@mail/core/common/message";
42
import {patch} from "@web/core/utils/patch";
53

@@ -15,6 +13,8 @@ patch(Message, {
1513

1614
patch(Message.prototype, {
1715
get canReply() {
18-
return Boolean(this.message.res_id && isMessageTypeValid(this.message.type));
16+
return Boolean(
17+
this.message.res_id && isMessageTypeValid(this.message.message_type)
18+
);
1919
},
2020
});

mail_quoted_reply/static/src/message_service.esm.js

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)