diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2024-02-29 14:21:05 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2024-02-29 14:21:05 +0700 |
| commit | 0b5b43646b92298dddcdb7eec1a590d90cadd1e8 (patch) | |
| tree | 2b34e0e79bc2612183831a35f96fb7550d17f99b /indoteknik_custom/models/web_logging/web_utm_source.py | |
| parent | ee48a727e2617d8e094847dfb5bf9d5279db165a (diff) | |
Update feature user activity log with utm source
Diffstat (limited to 'indoteknik_custom/models/web_logging/web_utm_source.py')
| -rw-r--r-- | indoteknik_custom/models/web_logging/web_utm_source.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/indoteknik_custom/models/web_logging/web_utm_source.py b/indoteknik_custom/models/web_logging/web_utm_source.py new file mode 100644 index 00000000..baeb0e9b --- /dev/null +++ b/indoteknik_custom/models/web_logging/web_utm_source.py @@ -0,0 +1,17 @@ +from odoo import fields, models + + +class UserActivityLog(models.Model): + _name = 'web.utm.source' + + name = fields.Char(string='Name') + key = fields.Char(string='Key', unique=True) + + def find_or_create_key(self, key): + utm_source = self.search([('key', '=', key)], limit=1) + if not utm_source: + utm_source = self.create({ + 'name': key, + 'key': key + }) + return utm_source
\ No newline at end of file |
