From aeb50c4ede78b7f101c5ccf7a63a2fb81ec3aae0 Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Thu, 16 Feb 2023 14:52:01 +0700 Subject: bug fix wati to leads --- indoteknik_custom/models/wati.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/indoteknik_custom/models/wati.py b/indoteknik_custom/models/wati.py index 57ba9a4a..0a4da9e1 100644 --- a/indoteknik_custom/models/wati.py +++ b/indoteknik_custom/models/wati.py @@ -18,6 +18,7 @@ class WatiNotification(models.Model): watis = self.env['wati.notification'].search(query, order='id') for wati in watis: + _logger.info('Convert Lead ID %s' % wati.id) ticket_id = json.loads(wati.json_raw)['ticketId'] text = json.loads(wati.json_raw)['text'] @@ -27,13 +28,13 @@ class WatiNotification(models.Model): if current_lead: # must append internal notes as a reply here - current_lead.description = current_lead.description + "|" +text + current_lead.description = current_lead.description + "|" +str(text) wati.is_lead = True else: # create new leads contact_name = json.loads(wati.json_raw)['senderName'] phone = json.loads(wati.json_raw)['waId'] - name = 'Ada pesan dari WATI '+phone+' '+contact_name + name = 'Ada pesan dari WATI '+str(phone)+' '+str(contact_name) self.env['crm.lead'].create([{ 'name': name, -- cgit v1.2.3