| REPOSITORY | |
|---|---|
| REPOSITORY | OCA/server-tools |
| GIT | |
| GIT | https://github.com/OCA/server-tools.git |
| GIT FOLDER | |
| GIT FOLDER | https://github.com/OCA/server-tools/tree/11.0/record_archiver |
| VERSION | |
| VERSION | 1.0.0 |
| CATEGORY | |
| CATEGORY | misc |
| LICENSE | |
| LICENSE | AGPL-3 |
| APPLICATION | |
| APPLICATION | No |
| AUTO-INSTALLABLE | |
| AUTO-INSTALLABLE | No |
| AUTHORS | |
| AUTHORS | Odoo Community Association (OCA), Camptocamp |
| MAINTAINERS | |
| MAINTAINERS | Odoo Community Association (OCA), Camptocamp |
| COMMITTERS | |
| COMMITTERS | oca-travis, OCA-git-bot, Artem Kostyuk |
| WEBSITE | |
| WEBSITE | https://github.com/OCA/server-tools |
| LAST TRACKING UPDATE | |
| LAST TRACKING UPDATE | 2026-07-06 00:24:00 |
| ODOO DEPENDENCIES | |
| ODOO DEPENDENCIES |
odoo/odoo: - base |
| PYTHON DEPENDENCIES | |
| PYTHON DEPENDENCIES | Not have |
| SYSTEM DEPENDENCIES | |
| SYSTEM DEPENDENCIES | Not have |
| DESCRIPTION | |
| DESCRIPTION | |
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
view_record_lifespan_search |
record.lifespan.search | record.lifespan | search | New |
view_record_lifespan_tree |
record.lifespan.tree | record.lifespan | tree | New |
has_an_active_field
Boolean
compute=_compute_has_an_active_field
search=_search_has_an_active_field
string='Has an active field'
No public methods.
archive_states
Char
help="Comma-separated list of states in which records should be archived. Implicit value is `'done, cancel')`."
model_id
Many2one → ir.model
domain=[('has_an_active_field', '=', True)]
required=True
string='Model'
args: 'ir.model'
model_name
Char
readonly=True
related='model_id.model'
string='Model Name'
months
Integer
help='Number of month after which the records will be set to inactive based on their write date'
required=True
archive_records(self)
| REPOSITORY | |
|---|---|
| REPOSITORY | OCA/server-tools |
| GIT | |
| GIT | https://github.com/OCA/server-tools.git |
| GIT FOLDER | |
| GIT FOLDER | https://github.com/OCA/server-tools/tree/9.0/record_archiver |
| VERSION | |
| VERSION | 1.0.0 |
| CATEGORY | |
| CATEGORY | misc |
| LICENSE | |
| LICENSE | AGPL-3 |
| APPLICATION | |
| APPLICATION | No |
| AUTO-INSTALLABLE | |
| AUTO-INSTALLABLE | No |
| AUTHORS | |
| AUTHORS | Odoo Community Association (OCA), Camptocamp |
| MAINTAINERS | |
| MAINTAINERS | Odoo Community Association (OCA), Camptocamp |
| COMMITTERS | |
| COMMITTERS | Yannick Vaucher, Guewen Baconnier, Stéphane Bidoul (ACSONE), oca-travis, OCA-git-bot |
| WEBSITE | |
| WEBSITE | https://github.com/OCA/server-tools |
| LAST TRACKING UPDATE | |
| LAST TRACKING UPDATE | 2026-07-06 00:15:22 |
| ODOO DEPENDENCIES | |
| ODOO DEPENDENCIES |
odoo/odoo: - base |
| PYTHON DEPENDENCIES | |
| PYTHON DEPENDENCIES | Not have |
| SYSTEM DEPENDENCIES | |
| SYSTEM DEPENDENCIES | Not have |
| DESCRIPTION | |
| DESCRIPTION | |
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
view_record_lifespan_search |
record.lifespan.search | record.lifespan | search | New |
view_record_lifespan_tree |
record.lifespan.tree | record.lifespan | tree | New |
has_an_active_field
Boolean
compute=_compute_has_an_active_field
search=_search_has_an_active_field
string='Has an active field'
No public methods.
model
Char
related='model_id.model'
store=True
string='Model Name'
model_id
Many2one → ir.model
domain=[('has_an_active_field', '=', True)]
required=True
string='Model'
args: 'ir.model'
months
Integer
help='Number of month after which the records will be set to inactive based on their write date'
required=True
archive_records(self)
| REPOSITORY | |
|---|---|
| REPOSITORY | OCA/server-tools |
| GIT | |
| GIT | https://github.com/OCA/server-tools.git |
| GIT FOLDER | |
| GIT FOLDER | https://github.com/OCA/server-tools/tree/7.0/record_archiver |
| VERSION | |
| VERSION | 0.1 |
| CATEGORY | |
| CATEGORY | misc |
| LICENSE | |
| LICENSE | AGPL-3 |
| APPLICATION | |
| APPLICATION | No |
| AUTO-INSTALLABLE | |
| AUTO-INSTALLABLE | No |
| AUTHORS | |
| AUTHORS | Odoo Community Association (OCA), Camptocamp |
| MAINTAINERS | |
| MAINTAINERS | Odoo Community Association (OCA), Camptocamp |
| COMMITTERS | |
| COMMITTERS | Guewen Baconnier |
| WEBSITE | |
| WEBSITE | www.camptocamp.com |
| LAST TRACKING UPDATE | |
| LAST TRACKING UPDATE | 2026-07-06 00:07:15 |
| ODOO DEPENDENCIES | |
| ODOO DEPENDENCIES |
odoo/odoo: - base |
| PYTHON DEPENDENCIES | |
| PYTHON DEPENDENCIES | Not have |
| SYSTEM DEPENDENCIES | |
| SYSTEM DEPENDENCIES | Not have |
| DESCRIPTION | |
| DESCRIPTION | Records Archiver ================ Create a cron job that deactivates old records in order to optimize performance. Records are deactivated based on their last activity (write_date). Configuration ============= You can configure lifespan of each type of record in `Settings -> Configuration -> Records Archiver` A different lifespan can be configured for each model. Usage ===== Once the lifespans are configured, the cron will automatically deactivate the old records. Known issues / Roadmap ====================== The default behavior is to archive all records having a ``write_date`` < lifespan and with a state being ``done`` or ``cancel``. If these rules need to be modified for a model (e.g. change the states to archive), the hook ``RecordLifespan._archive_domain`` can be extended. Bug Tracker =========== Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-tools/issues>`_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback `here <https://github.com/OCA/server-tools/issues/new?body=module:%20record_archiver%0Aversion:%207.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. Credits ======= Contributors ------------ * Yannick Vaucher <yannick.vaucher@camptocamp.com> * Guewen Baconnier <guewen.baconnier@camptocamp.com> Maintainer ---------- .. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association :target: https://odoo-community.org This module is maintained by the OCA. 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. To contribute to this module, please visit http://odoo-community.org. |
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
view_record_lifespan_search |
record.lifespan.search | record.lifespan | search | New |
view_record_lifespan_tree |
record.lifespan.tree | record.lifespan | tree | New |
No new fields.
Public methods (0)No public methods.
No new fields.
Public methods (1)archive_records(self, cr, uid, ids, context=None)