Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP [14.0][ADD] mail_message_date_order module #185

Draft
wants to merge 1 commit into
base: 14.0
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"],
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
odoo.define("mail_message_date_order/static/src/models/mail_message_date_order.js", function(require) {
"use strict";

function factory(dependencies) {
class ThreadCache extends dependencies['mail.model'] {

/**
* @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/models/mail_message_date_order.js"
/>
</xpath>
</template>
</odoo>