Skip to content
Open
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
92 changes: 92 additions & 0 deletions mail_sent_history/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=================
Mail Sent History
=================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:1e357a3b8146be1310054c9611a3265cb612eff883206fe2c4d0d81ff504c142
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmail-lightgray.png?logo=github
:target: https://github.com/OCA/mail/tree/17.0/mail_sent_history
:alt: OCA/mail
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/mail-17-0/mail-17-0-mail_sent_history
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/mail&target_branch=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

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.

**Table of contents**

.. contents::
:local:

Usage
=====

1. Open the Discuss (Mail) app from the main Odoo menu.
2. Click on the “Sent History” mailbox in the left-hand sidebar.
3. Browse all messages and notes that you have personally sent.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/mail/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/mail/issues/new?body=module:%20mail_sent_history%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* ForgeFlow

Contributors
------------

- `ForgeFlow <https://www.forgeflow.com>`__:

- Guillermo Navas <guillermo.navas@forgeflow.com>

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/mail <https://github.com/OCA/mail/tree/17.0/mail_sent_history>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions mail_sent_history/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from . import controllers
19 changes: 19 additions & 0 deletions mail_sent_history/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2026 ForgeFlow S.L. (https://www.forgeflow.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Mail Sent History",
"summary": "View and browse messages and notes you have sent",
"version": "17.0.1.0.0",
"category": "Social Network",
"website": "https://github.com/OCA/mail",
"author": "ForgeFlow, Odoo Community Association (OCA)",
"license": "AGPL-3",
"installable": True,
"depends": ["mail"],
"assets": {
"web.assets_backend": [
"mail_sent_history/static/src/js/*",
"mail_sent_history/static/src/xml/*",
],
},
}
1 change: 1 addition & 0 deletions mail_sent_history/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import mailbox
24 changes: 24 additions & 0 deletions mail_sent_history/controllers/mailbox.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.

from odoo import http
from odoo.http import request


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()}
Comment thread
GuillermoNforgeflow marked this conversation as resolved.
42 changes: 42 additions & 0 deletions mail_sent_history/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_sent_history
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-02-27 12:50+0000\n"
"PO-Revision-Date: 2026-02-27 12:50+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: mail_sent_history
#: model:ir.model,name:mail_sent_history.model_mail_message
msgid "Message"
msgstr "Mensaje"

#. module: mail_sent_history
#. odoo-javascript
#: code:addons/mail_sent_history/static/src/xml/thread_icon.xml:0
#, python-format
msgid "Sent History"
msgstr "Historial de enviados"

#. module: mail_sent_history
#. odoo-javascript
#: code:addons/mail_sent_history/static/src/xml/thread.xml:0
#, python-format
msgid "This mailbox will display messages or notes you have sent."
msgstr "Este buzón mostrará los mensajes o notas que hayas enviado."

#. module: mail_sent_history
#. odoo-javascript
#: code:addons/mail_sent_history/static/src/xml/thread.xml:0
#, python-format
msgid "You have not sent any messages or added any notes yet"
msgstr "Aún no has enviado ningún mensaje ni añadido ninguna nota."
1 change: 1 addition & 0 deletions mail_sent_history/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import mail_message
38 changes: 38 additions & 0 deletions mail_sent_history/models/mail_message.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
from datetime import datetime

from odoo import api, models


class MailMessage(models.Model):
_inherit = "mail.message"

@api.model
def get_sent_history(self, limit=30, before=None, after=None):
partner = self.env.user.partner_id
domain = [
("author_id", "=", partner.id),
("message_type", "in", ["comment"]),
]

res = self._message_fetch(
domain,
before=before,
after=after,
limit=limit,
)
messages = res["messages"]._filter_existing_records()
messages_formatted = messages.message_format()
messages_sorted = sorted(
messages_formatted,
key=lambda m: m["date"] or datetime.min,
)
return {**res, "messages": messages_sorted}

def _filter_existing_records(self):
existing = self.browse()
for message in self:
if not message.model or not message.res_id:
existing += message
elif self.env[message.model].browse(message.res_id).exists():
existing += message
return existing
3 changes: 3 additions & 0 deletions mail_sent_history/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
2 changes: 2 additions & 0 deletions mail_sent_history/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- [ForgeFlow](https://www.forgeflow.com):
- Guillermo Navas \<<guillermo.navas@forgeflow.com>\>
4 changes: 4 additions & 0 deletions mail_sent_history/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
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.
3 changes: 3 additions & 0 deletions mail_sent_history/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1. Open the Discuss (Mail) app from the main Odoo menu.
2. Click on the “Sent History” mailbox in the left-hand sidebar.
3. Browse all messages and notes that you have personally sent.
Loading
Loading