Skip to content

Commit a47197b

Browse files
author
GuillermoNforgeflow
committed
fixup! [ADD]mail_sent_history
1 parent 4126ad1 commit a47197b

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

mail_sent_history/models/mail_message.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def get_sent_history(self):
1313
("author_id", "=", partner.id),
1414
("message_type", "in", ["comment"]),
1515
],
16-
order="date desc",
16+
order="date asc",
1717
)
1818

1919
return messages.message_format()
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/* @odoo-module */
2+
3+
import {ThreadService} from "@mail/core/common/thread_service";
4+
import {patch} from "@web/core/utils/patch";
5+
6+
patch(ThreadService.prototype, {
7+
async post() {
8+
const message = await super.post(...arguments);
9+
10+
if (message?.isSelfAuthored) {
11+
if (!this.store.discuss.sent_history.messages.includes(message)) {
12+
this.store.discuss.sent_history.messages.add(message);
13+
}
14+
}
15+
16+
return message;
17+
},
18+
});

0 commit comments

Comments
 (0)