Maintainers
+Maintainers
This module is maintained by the OCA.

diff --git a/autovacuum_message_attachment/README.rst b/autovacuum_message_attachment/README.rst index e9a5cc447..ac72f6582 100644 --- a/autovacuum_message_attachment/README.rst +++ b/autovacuum_message_attachment/README.rst @@ -42,17 +42,79 @@ messages you want to delete automatically. Configuration ============= -- Go to the menu configuration => Technical => Email => Message And - Attachment Vacuum Rules -- Add the adequates rules for your company. On each rule, you can - indicate the models, type and subtypes for which you want to delete - the messages, along with a retention time (in days). Or for - attachment, you can specify a substring of the name. -- Activate the cron AutoVacuum Mails and Messages and/or AutoVacuum - Attachments +To Create AutoVacuum Rules +-------------------------- -It is recommanded to run it frequently and when the system is not very -loaded. (For instance : once a day, during the night.) +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.) + +.. |image1| image:: https://raw.githubusercontent.com/OCA/server-tools/17.0/autovacuum_message_attachment/static/description/Attachment_Vacuum_Rule.png +.. |image2| image:: https://raw.githubusercontent.com/OCA/server-tools/17.0/autovacuum_message_attachment/static/description/Message_Vacuum_Rule.png +.. |image3| image:: https://raw.githubusercontent.com/OCA/server-tools/17.0/autovacuum_message_attachment/static/description/AutoVacuum_Cron_Jobs.png +.. |image4| image:: https://raw.githubusercontent.com/OCA/server-tools/17.0/autovacuum_message_attachment/static/description/AutoVacuum_Cron_Jobs2.png Known issues / Roadmap ====================== diff --git a/autovacuum_message_attachment/models/vacuum_rule.py b/autovacuum_message_attachment/models/vacuum_rule.py index 6d47e90b3..2d28bf876 100644 --- a/autovacuum_message_attachment/models/vacuum_rule.py +++ b/autovacuum_message_attachment/models/vacuum_rule.py @@ -54,13 +54,12 @@ class VacuumRule(models.Model): ) model_id = fields.Many2one( "ir.model", - readonly=True, compute="_compute_model_id", help="Technical field used to set attributes (invisible/required, " "domain, etc...for other fields, like the domain filter", ) model_filter_domain = fields.Text() - model = fields.Char(readonly=True, compute="_compute_model_id", string="Model code") + model = fields.Char(compute="_compute_model_id", string="Model code") empty_model = fields.Boolean( help="Take into account attachment not linked to any model, but only if a " "pattern is set, to avoid deleting attachments generated/needed by odoo" diff --git a/autovacuum_message_attachment/readme/CONFIGURE.md b/autovacuum_message_attachment/readme/CONFIGURE.md index 05c941a35..c2bf1ca15 100644 --- a/autovacuum_message_attachment/readme/CONFIGURE.md +++ b/autovacuum_message_attachment/readme/CONFIGURE.md @@ -1,11 +1,51 @@ -- Go to the menu configuration =\> Technical =\> Email =\> Message And - Attachment Vacuum Rules -- Add the adequates rules for your company. On each rule, you can - indicate the models, type and subtypes for which you want to delete - the messages, along with a retention time (in days). Or for - attachment, you can specify a substring of the name. -- Activate the cron AutoVacuum Mails and Messages and/or AutoVacuum - Attachments +## To Create AutoVacuum Rules -It is recommanded to run it frequently and when the system is not very -loaded. (For instance : once a day, during the night.) +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 ".png") +- **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) + + + +## 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) + + + +## 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 + + + + + + +Note: It is recommended to run it frequently and when the system is not very loaded. (For instance: once a day, during the night.) diff --git a/autovacuum_message_attachment/static/description/Attachment_Vacuum_Rule.png b/autovacuum_message_attachment/static/description/Attachment_Vacuum_Rule.png new file mode 100644 index 000000000..705b99fdd Binary files /dev/null and b/autovacuum_message_attachment/static/description/Attachment_Vacuum_Rule.png differ diff --git a/autovacuum_message_attachment/static/description/AutoVacuum_Cron_Jobs.png b/autovacuum_message_attachment/static/description/AutoVacuum_Cron_Jobs.png new file mode 100644 index 000000000..fb0687773 Binary files /dev/null and b/autovacuum_message_attachment/static/description/AutoVacuum_Cron_Jobs.png differ diff --git a/autovacuum_message_attachment/static/description/AutoVacuum_Cron_Jobs2.png b/autovacuum_message_attachment/static/description/AutoVacuum_Cron_Jobs2.png new file mode 100644 index 000000000..b3cdefa29 Binary files /dev/null and b/autovacuum_message_attachment/static/description/AutoVacuum_Cron_Jobs2.png differ diff --git a/autovacuum_message_attachment/static/description/Message_Vacuum_Rule.png b/autovacuum_message_attachment/static/description/Message_Vacuum_Rule.png new file mode 100644 index 000000000..7ce99885a Binary files /dev/null and b/autovacuum_message_attachment/static/description/Message_Vacuum_Rule.png differ diff --git a/autovacuum_message_attachment/static/description/index.html b/autovacuum_message_attachment/static/description/index.html index 0dec95981..de7b2fa47 100644 --- a/autovacuum_message_attachment/static/description/index.html +++ b/autovacuum_message_attachment/static/description/index.html @@ -378,34 +378,93 @@ messages you want to delete automatically.
Table of contents
Go to Settings -> Technical -> Email -> Message And Attachment Vacuum +Rules
It is recommanded to run it frequently and when the system is not very -loaded. (For instance : once a day, during the night.)
+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
+Note: It is recommanded to run it frequently and when the system is not +very loaded. (For instance : once a day, during the night.)
+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 @@ -413,7 +472,7 @@ to be specific enough on the other criterias (concerned models…) to avoid unwanted attachment deletion.
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 @@ -421,15 +480,15 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
Do not contact contributors directly about support or help with technical issues.
This module is maintained by the OCA.