summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2023-02-16 14:52:01 +0700
committerstephanchrst <stephanchrst@gmail.com>2023-02-16 14:52:01 +0700
commitaeb50c4ede78b7f101c5ccf7a63a2fb81ec3aae0 (patch)
tree071a968b9cd506ae304ac5ac828ba229d327fa19
parent5413d6ae243fc2c9dd37930097928d51ef961aaa (diff)
bug fix wati to leads
-rw-r--r--indoteknik_custom/models/wati.py5
1 files 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,