From 0b5b43646b92298dddcdb7eec1a590d90cadd1e8 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Thu, 29 Feb 2024 14:21:05 +0700 Subject: Update feature user activity log with utm source --- indoteknik_custom/models/web_logging/web_utm_source.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 indoteknik_custom/models/web_logging/web_utm_source.py (limited to 'indoteknik_custom/models/web_logging/web_utm_source.py') 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 -- cgit v1.2.3