AutoVacuum Mail Message and Attachment

Beta License: LGPL-3 OCA/server-tools Translate me on Weblate Try me on Runboat

Odoo create a lot of message and/or mails. With time it can slow the system or take a lot of disk space. The goal of this module is to clean these message once they are obsolete. The same may happen with attachment that we store. You can choose various criterias manage which messages you want to delete automatically.

Table of contents

Configuration

To Create AutoVacuum Rules

Go to Settings -> Technical -> Email -> Message And Attachment Vacuum Rules

  • Press the “New” button to add a new rule

To Configure the Attachment AutoVacuum Rule

  • Name: Set the name of the rule
  • Type: Select type “Attachment”
  • Company: Select a Company
  • Retention Time: Set Retention Time in days
  • Filename Pattern: Set file name pattern (for example “.pdf”)
  • Inherited Model: Set the Inherited Model (optional)
  • Model: Select the Model to apply the rule to
  • Model Filter Domain: Specify the domain for the model to select particular records only
  • Description: Add a description for the rule set (optional)

image1

To Configure the Message AutoVacuum Rule

  • Name: Set the name of the rule
  • Type: Select type “Message”
  • Company: Select a Company
  • Retention Time: Set Retention Time in days
  • Message Type: Select the Message Type to apply the rule to:
    • All: Apply to all messages
    • Comment: Apply to comments
    • System Notification: Apply to system notifications
    • User Specific Notification: Apply to user specific notifications
  • Empty Subtype: Apply to messages with no subtype
  • Message Subtype: Press the “Add line” button and select the Chatter Message Subtype to apply the rule to
  • Model: Select the Model to apply the rule to
  • Message Filter Domain: Specify the domain for the model to select particular records only
  • Description: Add a description for the rule set (optional)

image2

To Configure AutoVacuum Cron Jobs

Note: The AutoVacuum Mails and Messages and AutoVacuum Attachments scheduled actions are created by default and need to be activated.

Go to Settings -> Technical -> Automation -> Scheduled Actions

  • Activate the scheduled actions needed (AutoVacuum Mails and Messages and/or AutoVacuum Attachments)
  • Go to Actions -> Unarchive or toggle the Active status of the scheduled action
  • Select a record and specify the frequency of the cron job if needed

image3

image4

Note: It is recommanded to run it frequently and when the system is not very loaded. (For instance : once a day, during the night.)

Known issues / Roadmap

You have to be careful with rules regarding attachment deletion because Odoo find the attachment to delete with their name. Odoo will find all attachments containing the substring configured on the rule, so you have to be specific enough on the other criterias (concerned models…) to avoid unwanted attachment deletion.

Bug Tracker

Bugs are tracked on GitHub 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.

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

Credits

Authors

  • Akretion

Maintainers

This module is maintained by the OCA.

Odoo Community Association

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.

Current maintainer:

florian-dacosta

This module is part of the OCA/server-tools project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.