-
-
Notifications
You must be signed in to change notification settings - Fork 134
[17.0][ADD]mail_sent_history #155
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
Open
GuillermoNforgeflow
wants to merge
1
commit into
OCA:17.0
Choose a base branch
from
ForgeFlow:17.0-add-mail_sent_history
base: 17.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,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. |
This file contains hidden or 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,2 @@ | ||
| from . import models | ||
| from . import controllers |
This file contains hidden or 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,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/*", | ||
| ], | ||
| }, | ||
| } |
This file contains hidden or 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 @@ | ||
| from . import mailbox |
This file contains hidden or 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,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()} | ||
This file contains hidden or 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,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." |
This file contains hidden or 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 @@ | ||
| from . import mail_message |
This file contains hidden or 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,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 |
This file contains hidden or 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,3 @@ | ||
| [build-system] | ||
| requires = ["whool"] | ||
| build-backend = "whool.buildapi" |
This file contains hidden or 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,2 @@ | ||
| - [ForgeFlow](https://www.forgeflow.com): | ||
| - Guillermo Navas \<<guillermo.navas@forgeflow.com>\> |
This file contains hidden or 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,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. |
This file contains hidden or 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,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. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.