-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] new module mail_message_date_order
- Loading branch information
1 parent
44a92bd
commit 2de5907
Showing
4 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
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,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
29
mail_message_date_order/static/src/js/mail_message_date_order.js
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.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; | ||
} | ||
|
||
|
||
|
||
} | ||
} | ||
|
||
}); |
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,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> |