-
-
Notifications
You must be signed in to change notification settings - Fork 618
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] mail_quoted_reply: Migration to 17.0
- Loading branch information
Showing
14 changed files
with
108 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
The migration from 16.0 to 17.0 of this module were financially supported by Camptocamp. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* @odoo-module */ | ||
|
||
import {messageActionsRegistry} from "@mail/core/common/message_actions"; | ||
|
||
messageActionsRegistry.add("reply", { | ||
icon: "fa-reply", | ||
title: "Reply", | ||
onClick: (component) => | ||
component.messageService.messageReply(component.props.message), | ||
condition: (component) => component.canReply, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* @odoo-module */ | ||
|
||
import {Message} from "@mail/core/common/message"; | ||
import {patch} from "@web/core/utils/patch"; | ||
|
||
export const MESSAGE_TYPES = ["email", "comment"]; | ||
|
||
export const isMessageTypeValid = (type) => { | ||
return MESSAGE_TYPES.includes(type); | ||
}; | ||
|
||
patch(Message, { | ||
components: {...Message.components}, | ||
}); | ||
|
||
patch(Message.prototype, { | ||
get canReply() { | ||
return Boolean(this.message.res_id && isMessageTypeValid(this.message.type)); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* @odoo-module */ | ||
|
||
import {patch} from "@web/core/utils/patch"; | ||
import {MessageService} from "@mail/core/common/message_service"; | ||
import {useService} from "@web/core/utils/hooks"; | ||
|
||
patch(MessageService.prototype, { | ||
setup() { | ||
super.setup(); | ||
this.threadService = useService("mail.thread"); | ||
}, | ||
|
||
async messageReply(message) { | ||
var self = this; | ||
const thread = message.originThread; | ||
await this.orm | ||
.call("mail.message", "reply_message", [message.id]) | ||
.then(function (result) { | ||
return self.env.services.action.doAction(result, { | ||
onClose: async () => { | ||
await self.env.services["mail.thread"].fetchData(thread, [ | ||
"messages", | ||
]); | ||
self.env.bus.trigger("update-messages"); | ||
}, | ||
}); | ||
}); | ||
}, | ||
}); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
26 changes: 0 additions & 26 deletions
26
mail_quoted_reply/static/src/models/message_action_list.esm.js
This file was deleted.
Oops, something went wrong.
44 changes: 0 additions & 44 deletions
44
mail_quoted_reply/static/src/models/message_action_view.esm.js
This file was deleted.
Oops, something went wrong.