summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-10-17 11:16:36 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-10-17 11:16:36 +0700
commitfbc278bc843fe429db0ac261da0fd0dfe753acaf (patch)
tree6cc899f6ba9ac1f09fee83d7b36b397a35018701
parent670ce7ebbcb6b075d6fa3d1e6ae8dcaacd76721e (diff)
clean user activity log without email
-rwxr-xr-xindoteknik_custom/models/user_activity_log.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/indoteknik_custom/models/user_activity_log.py b/indoteknik_custom/models/user_activity_log.py
index 558e5b5c..07079714 100755
--- a/indoteknik_custom/models/user_activity_log.py
+++ b/indoteknik_custom/models/user_activity_log.py
@@ -9,3 +9,8 @@ class UserActivityLog(models.Model):
url = fields.Char(string="URL")
res_user_id = fields.Many2one("res.users", string="User")
email = fields.Char(string="Email")
+
+ def clean_activity_log(self):
+ self.env['user.activity.log'].search([
+ ('email', 'not ilike', '%@%'),
+ ]).unlink()