AutoVacuum Mail Message and Attachment

autovacuum_message_attachment
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/18.0/autovacuum_message_attachment
VERSION
VERSION 1.0.1
CATEGORY
CATEGORYTools
LICENSE
LICENSELGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Akretion
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Akretion
COMMITTERS
COMMITTERSWeblate, OCA-git-bot, oca-ci, Maksym Yankin, Ricardoalso
WEBSITE
WEBSITEhttps://github.com/OCA/server-tools
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 19:30:07
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - mail
    - base
    - base_setup
    - web
    - bus
    - web_tour
    - html_editor
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION
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.

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
vacuum_rule_form_view vacuum.rule.form.view vacuum.rule form New
vacuum_rule_tree_view vacuum.rule.form.view vacuum.rule list New
Models touched (5)

New fields (0)

No new fields.

Public methods (2)
  • autovacuum(self, ttype='message')
    @api.model
  • batch_unlink(self)

New fields (1)
  • assigned_attachment_ids One2many → ir.attachment
    auto_join=True domain=<expr> string='Assigned Attachments' args: 'ir.attachment', 'res_id'
Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (16)
  • active Boolean
    default=True
  • company_id Many2one → res.company
    default=<expr> string='Company' args: 'res.company'
  • description Text
  • empty_model 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'
  • empty_subtype Boolean
    help='Take also into account messages with no subtypes'
  • filename_pattern Char
    help='If set, only attachments containing this pattern will be deleted.'
  • inheriting_model Char
    help='If set, this model will be searched and only related attachments will be deleted.\n\nN.B: model must implement _inherits to link ir.attachment'
  • message_subtype_ids Many2many → mail.message.subtype
    help="Message subtypes concerned by the rule. If left empty, the system won't take the subtype into account to find the messages to delete" string='Subtypes' args: 'mail.message.subtype'
  • message_type Selection
    args: [('email', 'Email'), ('comment', 'Comment'), ('notification', 'System notification'), ('user_notification', 'User Specific Notification'), ('all', 'All')]
  • model Char
    compute='_compute_model_id' string='Model code'
  • model_filter_domain Text
  • model_id Many2one → ir.model
    compute='_compute_model_id' help='Technical field used to set attributes (invisible/required, domain, etc...for other fields, like the domain filter' args: 'ir.model'
  • model_ids Many2many → ir.model
    help='Models concerned by the rule. If left empty, it will take all models into account' string='Models' args: 'ir.model'
  • name Char
    required=True
  • retention_time Integer
    default=365 help='Number of days the messages concerned by this rule will be keeped in the database after creation. Once the delay is passed, they will be automatically deleted.' required=True
  • ttype Selection
    required=True selection=[('attachment', 'Attachment'), ('message', 'Message')] string='Type'
Public methods (1)
  • retention_time_not_null(self)
    @api.constrains('retention_time')
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/16.0/autovacuum_message_attachment
VERSION
VERSION 1.0.1
CATEGORY
CATEGORYTools
LICENSE
LICENSELGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Akretion
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Akretion
COMMITTERS
COMMITTERSFlorian da Costa, Weblate, OCA-git-bot, oca-ci
WEBSITE
WEBSITEhttps://github.com/OCA/server-tools
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:53:53
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - mail
    - base
    - base_setup
    - web
    - bus
    - web_tour
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
vacuum_rule_form_view vacuum.rule.form.view vacuum.rule form New
vacuum_rule_tree_view vacuum.rule.form.view vacuum.rule tree New
Models touched (5)

New fields (0)

No new fields.

Public methods (2)
  • autovacuum(self, ttype='message')
    @api.model
  • batch_unlink(self)

New fields (1)
  • assigned_attachment_ids One2many → ir.attachment
    auto_join=True domain=<expr> string='Assigned Attachments' args: 'ir.attachment', 'res_id'
Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (16)
  • active Boolean
    default=True
  • company_id Many2one → res.company
    default=<expr> string='Company' args: 'res.company'
  • description Text
  • empty_model 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'
  • empty_subtype Boolean
    help='Take also into account messages with no subtypes'
  • filename_pattern Char
    help='If set, only attachments containing this pattern will be deleted.'
  • inheriting_model Char
    help='If set, this model will be searched and only related attachments will be deleted.\n\nN.B: model must implement _inherits to link ir.attachment'
  • message_subtype_ids Many2many → mail.message.subtype
    help="Message subtypes concerned by the rule. If left empty, the system won't take the subtype into account to find the messages to delete" string='Subtypes' args: 'mail.message.subtype'
  • message_type Selection
    args: [('email', 'Email'), ('comment', 'Comment'), ('notification', 'System notification'), ('user_notification', 'User Specific Notification'), ('all', 'All')]
  • model Char
    compute='_compute_model_id' readonly=True string='Model code'
  • model_filter_domain Text
  • model_id Many2one → ir.model
    compute='_compute_model_id' help='Technical field used to set attributes (invisible/required, domain, etc...for other fields, like the domain filter' readonly=True args: 'ir.model'
  • model_ids Many2many → ir.model
    help='Models concerned by the rule. If left empty, it will take all models into account' string='Models' args: 'ir.model'
  • name Char
    required=True
  • retention_time Integer
    default=365 help='Number of days the messages concerned by this rule will be keeped in the database after creation. Once the delay is passed, they will be automatically deleted.' required=True
  • ttype Selection
    required=True selection=[('attachment', 'Attachment'), ('message', 'Message')] string='Type'
Public methods (1)
  • retention_time_not_null(self)
    @api.constrains('retention_time')
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/14.0/autovacuum_message_attachment
VERSION
VERSION 1.0.1
CATEGORY
CATEGORYTools
LICENSE
LICENSELGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Akretion
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Akretion
COMMITTERS
COMMITTERSAkim Juillerat, OCA Transbot, oca-travis, Weblate, OCA-git-bot, oca-ci, hkpatel
WEBSITE
WEBSITEhttps://github.com/OCA/server-tools
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:41:05
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - mail
    - base
    - base_setup
    - web
    - bus
    - web_tour
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
vacuum_rule_form_view vacuum.rule.form.view vacuum.rule form New
vacuum_rule_tree_view vacuum.rule.form.view vacuum.rule tree New
Models touched (5)

New fields (0)

No new fields.

Public methods (2)
  • autovacuum(self, ttype='message')
    @api.model
  • batch_unlink(self)

New fields (1)
  • assigned_attachment_ids One2many → ir.attachment
    auto_join=True domain=<expr> string='Assigned Attachments' args: 'ir.attachment', 'res_id'
Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (15)
  • active Boolean
    default=True
  • company_id Many2one → res.company
    default=<expr> string='Company' args: 'res.company'
  • description Text
  • empty_subtype Boolean
    help='Take also into account messages with no subtypes'
  • filename_pattern Char
    help='If set, only attachments containing this pattern will be deleted.'
  • inheriting_model Char
    help='If set, this model will be searched and only related attachments will be deleted.\n\nN.B: model must implement _inherits to link ir.attachment'
  • message_subtype_ids Many2many → mail.message.subtype
    help="Message subtypes concerned by the rule. If left empty, the system won't take the subtype into account to find the messages to delete" string='Subtypes' args: 'mail.message.subtype'
  • message_type Selection
    args: [('email', 'Email'), ('comment', 'Comment'), ('notification', 'System notification'), ('all', 'All')]
  • model Char
    compute='_compute_model_id' readonly=True string='Model code'
  • model_filter_domain Text
    string='Model Filter Domain'
  • model_id Many2one → ir.model
    compute='_compute_model_id' help='Technical field used to set attributes (invisible/required, domain, etc...for other fields, like the domain filter' readonly=True args: 'ir.model'
  • model_ids Many2many → ir.model
    help='Models concerned by the rule. If left empty, it will take all models into account' string='Models' args: 'ir.model'
  • name Char
    required=True
  • retention_time Integer
    default=365 help='Number of days the messages concerned by this rule will be keeped in the database after creation. Once the delay is passed, they will be automatically deleted.' required=True
  • ttype Selection
    required=True selection=[('attachment', 'Attachment'), ('message', 'Message')] string='Type'
Public methods (1)
  • retention_time_not_null(self)
    @api.constrains('retention_time')
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/13.0/autovacuum_message_attachment
VERSION
VERSION 1.0.1
CATEGORY
CATEGORYTools
LICENSE
LICENSELGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Akretion
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Akretion
COMMITTERS
COMMITTERSStefan Rijnhart, Enric Tobella, OCA Transbot, oca-travis, Weblate, OCA-git-bot, oca-ci
WEBSITE
WEBSITEhttps://github.com/OCA/server-tools
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:34:16
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - mail
    - base
    - base_setup
    - web
    - bus
    - web_tour
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
vacuum_rule_form_view vacuum.rule.form.view vacuum.rule form New
vacuum_rule_tree_view vacuum.rule.form.view vacuum.rule tree New
Models touched (5)

New fields (0)

No new fields.

Public methods (2)
  • autovacuum(self, ttype='message')
    @api.model
  • batch_unlink(self)

New fields (1)
  • assigned_attachment_ids One2many → ir.attachment
    auto_join=True domain=<expr> string='Assigned Attachments' args: 'ir.attachment', 'res_id'
Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (14)
  • active Boolean
    default=True
  • company_id Many2one → res.company
    default=<expr> string='Company' args: 'res.company'
  • description Text
  • empty_subtype Boolean
    help='Take also into account messages with no subtypes'
  • filename_pattern Char
    help='If set, only attachments containing this pattern will be deleted.'
  • message_subtype_ids Many2many → mail.message.subtype
    help="Message subtypes concerned by the rule. If left empty, the system won't take the subtype into account to find the messages to delete" string='Subtypes' args: 'mail.message.subtype'
  • message_type Selection
    args: [('email', 'Email'), ('comment', 'Comment'), ('notification', 'System notification'), ('all', 'All')]
  • model Char
    compute='_compute_model_id' readonly=True string='Model code'
  • model_filter_domain Text
    string='Model Filter Domain'
  • model_id Many2one → ir.model
    compute='_compute_model_id' help='Technical field used to set attributes (invisible/required, domain, etc...for other fields, like the domain filter' readonly=True args: 'ir.model'
  • model_ids Many2many → ir.model
    help='Models concerned by the rule. If left empty, it will take all models into account' string='Models' args: 'ir.model'
  • name Char
    required=True
  • retention_time Integer
    default=365 help='Number of days the messages concerned by this rule will be keeped in the database after creation. Once the delay is passed, they will be automatically deleted.' required=True
  • ttype Selection
    required=True selection=[('attachment', 'Attachment'), ('message', 'Message')] string='Type'
Public methods (1)
  • retention_time_not_null(self)
    @api.constrains('retention_time')
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/12.0/autovacuum_message_attachment
VERSION
VERSION 1.1.1
CATEGORY
CATEGORYTools
LICENSE
LICENSELGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Akretion
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Akretion
COMMITTERS
COMMITTERSGitHub, Enric Tobella, OCA Transbot, Florian da Costa, oca-travis, Weblate, OCA-git-bot, oca-ci
WEBSITE
WEBSITEhttps://github.com/OCA/server-tools
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:29:22
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - mail
    - base
    - base_setup
    - web
    - bus
    - web_tour
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
vacuum_rule_form_view vacuum.rule.form.view vacuum.rule form New
vacuum_rule_tree_view vacuum.rule.form.view vacuum.rule tree New
Models touched (5)

New fields (0)

No new fields.

Public methods (2)
  • autovacuum(self, ttype='message')
    @api.model
  • batch_unlink(self)
    @api.multi

New fields (1)
  • assigned_attachment_ids One2many → ir.attachment
    auto_join=True domain=<expr> string='Assigned Attachments' args: 'ir.attachment', 'res_id'
Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (14)
  • active Boolean
    default=True
  • company_id Many2one → res.company
    default=<expr> string='Company' args: 'res.company'
  • description Text
  • empty_subtype Boolean
    help='Take also into account messages with no subtypes'
  • filename_pattern Char
    help='If set, only attachments containing this pattern will be deleted.'
  • message_subtype_ids Many2many → mail.message.subtype
    help="Message subtypes concerned by the rule. If left empty, the system won't take the subtype into account to find the messages to delete" string='Subtypes' args: 'mail.message.subtype'
  • message_type Selection
    args: [('email', 'Email'), ('comment', 'Comment'), ('notification', 'System notification'), ('all', 'All')]
  • model Char
    compute='_get_model_id' readonly=True string='Model code'
  • model_filter_domain Text
    string='Model Filter Domain'
  • model_id Many2one → ir.model
    compute='_get_model_id' help='Technical field used to set attributes (invisible/required, domain, etc...for other fields, like the domain filter' readonly=True args: 'ir.model'
  • model_ids Many2many → ir.model
    help='Models concerned by the rule. If left empty, it will take all models into account' string='Models' args: 'ir.model'
  • name Char
    required=True
  • retention_time Integer
    default=365 help='Number of days the messages concerned by this rule will be keeped in the database after creation. Once the delay is passed, they will be automatically deleted.' required=True
  • ttype Selection
    required=True selection=[('attachment', 'Attachment'), ('message', 'Message')] string='Type'
Public methods (1)
  • retention_time_not_null(self)
    @api.multi@api.constrains('retention_time')