Reputation: 1314
I have noticed that my Odoo16-Database size has drastically grown over the last months. And i want to clear all the obsolete records of all involved models (notifications, web visitors...).
The Odoo - Data Cleaning App enables to perform cleaning actions but not on all models.
I have started with Web-visitors cleaning by writing this ir-cron Task to delete records older than 15 days:
env['website.visitor'].search([('create_date','<',datetime.datetime.now()-datetime.timedelta(days=15))]).unlink()
env['mail.notification'].search([('notification_status','!=','ready'),('mail_message_id.date','<',datetime.datetime.now()-datetime.timedelta(days=360))]).unlink()
How about the records of the 'mail.message'
-model linked to the'mail.notification'
-model via a Many2One field ?
Do you know what other models could be cleaned in odoo to keep DB as light as possibe ?
Upvotes: 0
Views: 76