Skip to content

Commit

Permalink
[ADD] new module mail_message_date_order
Browse files Browse the repository at this point in the history
  • Loading branch information
clementmbr committed Sep 29, 2022
1 parent 44a92bd commit 2de5907
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 0 deletions.
Empty file.
17 changes: 17 additions & 0 deletions mail_message_date_order/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2021 Akretion
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Mail Message Date Order",
"description": """
Order chatter's messages by date instead of by ID
""",
"version": "14.0.1.0.0",
"license": "AGPL-3",
"author": "Akretion",
"website": "akretion.com",
"depends": ["mail"],
"data": [],
"demo": [],
"data": ["views/mail_message_date_order.xml"],
}
29 changes: 29 additions & 0 deletions mail_message_date_order/static/src/js/mail_message_date_order.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
odoo.define("mail_message_date_order/static/src/js/mail_message_date_order.js", function(require) {
"use strict";

function factory(dependencies) {

class ThreadCache extends dependencies['mail.model'] {


// _willDelete() {
// this.env.browser.clearTimeout(this._loaderTimeout);
// return super._willDelete(...arguments);
// }

/**
* @override
*/
_computeOrderedMessages() {
const res = super._computeOrderedMessages(...arguments);
console.log("---IN OVERRIDE ORDERED MESSAGES cache");
// return [['replace', this.messages.sort((m1, m2) => m1.date._d < m2.date._d ? -1 : 1)]];
return res;
}



}
}

});
15 changes: 15 additions & 0 deletions mail_message_date_order/views/mail_message_date_order.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template
id="assets_backend"
name="mail_message_date_order assets"
inherit_id="mail.assets_backend"
>
<xpath expr="." position="inside">
<script
type="text/javascript"
src="/mail_message_date_order/static/src/js/mail_message_date_order.js"
/>
</xpath>
</template>
</odoo>

0 comments on commit 2de5907

Please sign in to comment.