From ad665c8c43ce77f27f1832f68cbfff6c328cbad0 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Thu, 29 Feb 2024 15:50:27 +0700 Subject: Fix web.utm.source on find_or_create_key --- indoteknik_custom/models/web_logging/web_utm_source.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (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 index baeb0e9b..08b1e514 100644 --- a/indoteknik_custom/models/web_logging/web_utm_source.py +++ b/indoteknik_custom/models/web_logging/web_utm_source.py @@ -5,11 +5,11 @@ class UserActivityLog(models.Model): _name = 'web.utm.source' name = fields.Char(string='Name') - key = fields.Char(string='Key', unique=True) + key = fields.Char(string='Key') def find_or_create_key(self, key): utm_source = self.search([('key', '=', key)], limit=1) - if not utm_source: + if not utm_source and key: utm_source = self.create({ 'name': key, 'key': key -- cgit v1.2.3