Data Cleaning¶
The Data Cleaning app keeps the database free of old and outdated records: customizable rules detect the records that have not changed for a given period of time, and either archive or delete them.
Note
The app is provided by the Data Recycle (data_recycle) module.
Recycle records¶
The Recycle Records dashboard displays the records detected by the recycle rules. Go to .
The RECYCLE RULES sidebar lists each of the active recycle rules. By default, the All option is selected, and the records are displayed with the following columns:
Record ID: the ID of the original record;
Record Name: the name or title of the original record.
Select a specific rule in the RECYCLE RULES sidebar to filter the records.
To recycle a record, click the Validate button on its row. Depending on how the rule is configured, the record is then archived or deleted from the database.
Tip
Discard a proposal by clicking the Discard button. The record is hidden from the list, and is not detected by the recycle rule again in the future.
View discarded records by selecting the Discarded filter from the search bar drop-down menu.
- menu
- Data Cleaning ‣ Recycle Records
- shows
- The Recycle Records dashboard with the "RECYCLE RULES" sidebar on the left and a list of records with the Record ID, Record Name columns and the Validate / Discard buttons.
- data
- Demo company "YourCompany HU"; one rule "Lead/Opportunity" with a few detected records.
- module
- data_recycle
- notes
- English UI, light theme, 1440px width.
Recycle record rules¶
The recycle rules set the conditions for how records are recycled. They can be configured for each model in the database, and with varying levels of specificity. To get started, go to .
Tip
Recycle rules run once a day, as part of the Data Recycle: Clean Records scheduled action. However, each rule can be run manually at any time.
By default, no recycle rules exist. Click New to create one.
On the rule form, first choose a Model for the rule to target. Selecting a model updates the rule title to the chosen model.
Optionally, configure a Filter to specify the records eligible for this rule. The number of eligible records is shown in the # record(s) link.
Next, configure the field and time range the rule uses to detect the records to recycle:
Time Field: select a date or datetime field of the model to base the time on;
Delta: type the length of time, which must be a whole number (e.g.
7);Delta Unit: select the unit of time (Days, Weeks, Months, or Years).
Then, select a Recycle Mode:
Manual: each detected record must be validated manually on the Recycle Records dashboard. This mode enables the Notify Users field, where the administrators to inform can be selected, together with the notification frequency (Notify every n Days, Weeks, or Months).
Automatic: the detected records are recycled automatically, without notifying users.
Lastly, select a Recycle Action to either Archive or Delete the records. If Delete is selected, choose whether or not to Include Archived records in the rule.
Note
The Archive action is only available for models that have an Active field; otherwise, Odoo raises an error when the rule is saved.
With the rule’s configuration complete, either close the rule form, or run the rule manually to instantly capture records to recycle.
Example
A recycle rule can be configured to delete archived leads and opportunities that were last updated a year ago, and with a specific lost reason, by using the following configuration:
Model: Lead/Opportunity
Filter:
Activeisnot setLost Reasonis inToo expensive
Time Field: Last Updated on (Lead/Opportunity)
Delta:
1Delta Unit: Years
Recycle Mode: Automatic
Recycle Action: Delete
Include Archived:
- menu
- Data Cleaning ‣ Configuration ‣ Rules ‣ Recycle Records
- shows
- A recycle rule form for Lead/Opportunity with the Filter, Time Field, Delta, Delta Unit, Recycle Mode, Recycle Action and Include Archived fields filled in as in the example, and the "Records" smart button.
- highlight
- The Recycle Mode and Recycle Action fields (red frame).
- data
- Rule on "Lead/Opportunity", lost reason "Too expensive".
- module
- data_recycle, crm
- notes
- English UI, light theme, 1440px width.
Manually run a recycle rule¶
To manually run a specific recycle rule at any time, go to , and select the rule to run.
Then, on the rule form, click the Run Now button at the top left. The Records smart button then displays the number of records captured.
Click the Records smart button to manage these records.