diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-10-17 11:16:36 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-10-17 11:16:36 +0700 |
| commit | fbc278bc843fe429db0ac261da0fd0dfe753acaf (patch) | |
| tree | 6cc899f6ba9ac1f09fee83d7b36b397a35018701 | |
| parent | 670ce7ebbcb6b075d6fa3d1e6ae8dcaacd76721e (diff) | |
clean user activity log without email
| -rwxr-xr-x | indoteknik_custom/models/user_activity_log.py | 5 |
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() |
