Skip to content

[17.0][ADD]mail_sent_history#155

Open
GuillermoNforgeflow wants to merge 1 commit intoOCA:17.0from
ForgeFlow:17.0-add-mail_sent_history
Open

[17.0][ADD]mail_sent_history#155
GuillermoNforgeflow wants to merge 1 commit intoOCA:17.0from
ForgeFlow:17.0-add-mail_sent_history

Conversation

@GuillermoNforgeflow
Copy link

This module introduces a “Sent History” mailbox in Odoo's messaging system, giving users a dedicated view of all messages and notes they have personally sent. Users can also search through their sent messages using the search bar.

@GuillermoNforgeflow GuillermoNforgeflow changed the title [17.0][ADD]mail_sent_history: view and browse messages and notes you have sent [17.0][ADD]mail_sent_history Feb 27, 2026
Copy link

@AndreuOForgeFlow AndreuOForgeFlow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting feature 💯 LGTM 👍

@GuillermoNforgeflow GuillermoNforgeflow force-pushed the 17.0-add-mail_sent_history branch from a47197b to aaee1f3 Compare March 4, 2026 09:46
Copy link
Contributor

@GuillemCForgeFlow GuillemCForgeFlow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the main problem is that it should be following the odoo way to load messages, so we should adapt more to follow odoo standards.

Comment on lines +1 to +2
# Part of Odoo. See LICENSE file for full copyright and licensing details.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Part of Odoo. See LICENSE file for full copyright and licensing details.

I would remove these copyright statements, it doesn't apply for OCA modules

Comment on lines +7 to +24
class MailboxControllerExtended(http.Controller):
@http.route(
"/mail/sent_history/messages", methods=["POST"], type="json", auth="user"
)
def discuss_sent_history_messages(
self, search_term=None, before=None, after=None, limit=30, around=None
):
partner_id = request.env.user.partner_id.id
domain = [("author_id", "=", partner_id), ("message_type", "in", ["comment"])]
res = request.env["mail.message"]._message_fetch(
domain,
search_term=search_term,
before=before,
after=after,
around=around,
limit=limit,
)
return {**res, "messages": res["messages"].message_format()}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is never used, right? where is it called?

Comment on lines +8 to +19
def get_sent_history(self):
partner = self.env.user.partner_id

messages = self.search(
[
("author_id", "=", partner.id),
("message_type", "in", ["comment"]),
],
order="date asc",
)

return messages.message_format()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is dangerous as we have no limit here in the search, this could cause perfomance issues in systems where we have lots of records

this set up will also cause the lazy load feature (existing in the other menus) to not work correctly

super.setup(...arguments);

this.messagingService.isReady.then(async () => {
const messages = await this.rpc(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about using orm.call instead, which is the most standard way


<t t-inherit="mail.DiscussSidebarMailboxes" t-inherit-mode="extension">
<xpath
expr="//div[contains(@class, 'd-flex') and contains(@class, 'flex-column')]"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can break anytime the parent template changes, you could use the DiscussSidebarMailboxes root component

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants