-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by pedrobaeza
- Loading branch information
Showing
14 changed files
with
699 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,109 @@ | ||
=================================================== | ||
Mail Notification - Clean up notifications in error | ||
=================================================== | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:9a004084c3440966fc0ecdfebe40e185c6fc5e59542d7b6a1b3985edbfa5c708 | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png | ||
:target: https://odoo-community.org/page/development-status | ||
:alt: Production/Stable | ||
.. |badge2| image:: https://img.shields.io/badge/licence-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/18.0/mail_notification_clean_status_error | ||
:alt: OCA/mail | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/mail-18-0/mail-18-0-mail_notification_clean_status_error | ||
: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=18.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
Delete email notifications in error. | ||
|
||
The scheduled action *Notification: Delete Notifications older than 6 | ||
Month* provided by Odoo is responsible to delete notifications that have | ||
been sent successfully. | ||
|
||
However, it doesn't delete the notifications that could not be sent, and | ||
their number could keep growing over time, impacting the performance of | ||
some queries related to the chatter. | ||
|
||
This module extends the scheduled action of Odoo to also delete such | ||
notifications. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
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_notification_clean_status_error%0Aversion:%2018.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 | ||
------- | ||
|
||
* Camptocamp | ||
|
||
Contributors | ||
------------ | ||
|
||
- `Camptocamp <https://www.camptocamp.com>`__: | ||
|
||
- Sébastien Alix <[email protected]> | ||
|
||
- `Trobz <https://trobz.com>`__: | ||
|
||
- Khoi (Kien Kim) <[email protected]> | ||
|
||
Other credits | ||
------------- | ||
|
||
The migration of this module from 17.0 to 18.0 was financially supported | ||
by: | ||
|
||
- Camptocamp. | ||
|
||
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. | ||
|
||
.. |maintainer-sebalix| image:: https://github.com/sebalix.png?size=40px | ||
:target: https://github.com/sebalix | ||
:alt: sebalix | ||
|
||
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__: | ||
|
||
|maintainer-sebalix| | ||
|
||
This module is part of the `OCA/mail <https://github.com/OCA/mail/tree/18.0/mail_notification_clean_status_error>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains 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 models |
This file contains 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,15 @@ | ||
# Copyright 2024 Camptocamp SA | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) | ||
{ | ||
"name": "Mail Notification - Clean up notifications in error", | ||
"summary": "Extend Odoo scheduled action to also delete notifications in error.", | ||
"version": "18.0.1.0.0", | ||
"category": "Mail", | ||
"website": "https://github.com/OCA/mail", | ||
"author": "Camptocamp, Odoo Community Association (OCA)", | ||
"license": "AGPL-3", | ||
"installable": True, | ||
"depends": ["mail"], | ||
"development_status": "Production/Stable", | ||
"maintainers": ["sebalix"], | ||
} |
34 changes: 34 additions & 0 deletions
34
mail_notification_clean_status_error/i18n/mail_notification_clean_status_error.pot
This file contains 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,34 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * mail_notification_clean_status_error | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 14.0\n" | ||
"Report-Msgid-Bugs-To: \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_notification_clean_status_error | ||
#: model:ir.model.fields,field_description:mail_notification_clean_status_error.field_mail_notification__display_name | ||
msgid "Display Name" | ||
msgstr "" | ||
|
||
#. module: mail_notification_clean_status_error | ||
#: model:ir.model.fields,field_description:mail_notification_clean_status_error.field_mail_notification__id | ||
msgid "ID" | ||
msgstr "" | ||
|
||
#. module: mail_notification_clean_status_error | ||
#: model:ir.model.fields,field_description:mail_notification_clean_status_error.field_mail_notification____last_update | ||
msgid "Last Modified on" | ||
msgstr "" | ||
|
||
#. module: mail_notification_clean_status_error | ||
#: model:ir.model,name:mail_notification_clean_status_error.model_mail_notification | ||
msgid "Message Notifications" | ||
msgstr "" |
This file contains 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_notification |
21 changes: 21 additions & 0 deletions
21
mail_notification_clean_status_error/models/mail_notification.py
This file contains 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,21 @@ | ||
# Copyright 2024 Camptocamp SA | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) | ||
|
||
from odoo import api, fields, models | ||
|
||
|
||
class MailNotification(models.Model): | ||
_inherit = "mail.notification" | ||
|
||
@api.model | ||
def _gc_notifications(self, max_age_days=180): | ||
res = super()._gc_notifications(max_age_days=max_age_days) | ||
# Extend GC to also delete notifications in error | ||
read_date = fields.Datetime.subtract(fields.Datetime.now(), days=max_age_days) | ||
domain = [ | ||
("is_read", "=", True), | ||
("read_date", "<", read_date), | ||
("notification_status", "in", ("bounce", "exception")), | ||
] | ||
self.search(domain).unlink() | ||
return res |
This file contains 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 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,5 @@ | ||
- [Camptocamp](https://www.camptocamp.com): | ||
- Sébastien Alix \<<[email protected]>\> | ||
|
||
- [Trobz](https://trobz.com): | ||
- Khoi (Kien Kim) \<<[email protected]>\> |
This file contains 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 @@ | ||
The migration of this module from 17.0 to 18.0 was financially supported by: | ||
|
||
- Camptocamp. |
12 changes: 12 additions & 0 deletions
12
mail_notification_clean_status_error/readme/DESCRIPTION.md
This file contains 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,12 @@ | ||
Delete email notifications in error. | ||
|
||
The scheduled action *Notification: Delete Notifications older than 6 | ||
Month* provided by Odoo is responsible to delete notifications that have | ||
been sent successfully. | ||
|
||
However, it doesn't delete the notifications that could not be sent, and | ||
their number could keep growing over time, impacting the performance of | ||
some queries related to the chatter. | ||
|
||
This module extends the scheduled action of Odoo to also delete such | ||
notifications. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.