summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/web_logging/web_utm_source.py
diff options
context:
space:
mode:
Diffstat (limited to 'indoteknik_custom/models/web_logging/web_utm_source.py')
-rw-r--r--indoteknik_custom/models/web_logging/web_utm_source.py17
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