diff --git a/frappe_whatsapp/frappe_whatsapp/doctype/whatsapp_message/whatsapp_message.json b/frappe_whatsapp/frappe_whatsapp/doctype/whatsapp_message/whatsapp_message.json index f8bcd38..c2a15fc 100644 --- a/frappe_whatsapp/frappe_whatsapp/doctype/whatsapp_message/whatsapp_message.json +++ b/frappe_whatsapp/frappe_whatsapp/doctype/whatsapp_message/whatsapp_message.json @@ -54,13 +54,6 @@ "label": "Status", "read_only": 1 }, - { - "allow_in_quick_entry": 1, - "fieldname": "message", - "fieldtype": "HTML Editor", - "label": "Message", - "set_only_once": 1 - }, { "allow_in_quick_entry": 1, "depends_on": "eval:(doc.type==\"Outgoing\");", @@ -70,10 +63,6 @@ "label": "TO ", "set_only_once": 1 }, - { - "fieldname": "column_break_5", - "fieldtype": "Column Break" - }, { "depends_on": "eval:(doc.type==\"Incoming\");", "fieldname": "from", @@ -81,6 +70,42 @@ "label": "From", "set_only_once": 1 }, + { + "default": "0", + "fieldname": "use_template", + "fieldtype": "Check", + "label": "Use Template" + }, + { + "depends_on": "eval:doc.use_template == 1", + "fieldname": "template", + "fieldtype": "Link", + "label": "Template", + "options": "WhatsApp Templates" + }, + { + "fieldname": "template_parameters", + "fieldtype": "Small Text", + "label": "Template Parameters", + "read_only": 1 + }, + { + "fieldname": "template_header_parameters", + "fieldtype": "Small Text", + "label": "Template Header Parameters", + "read_only": 1 + }, + { + "fieldname": "column_break_5", + "fieldtype": "Column Break" + }, + { + "allow_in_quick_entry": 1, + "fieldname": "message", + "fieldtype": "HTML Editor", + "label": "Message", + "set_only_once": 1 + }, { "allow_in_quick_entry": 1, "fieldname": "message_type", @@ -106,7 +131,7 @@ "fieldname": "content_type", "fieldtype": "Select", "label": "Content Type", - "options": "\ntext\ndocument\nimage\nvideo\naudio\nflow\nlocation\ncontacts", + "options": "\ntext\ndocument\nimage\nvideo\naudio\nflow\nreaction\nlocation\ncontact", "reqd": 1 }, { @@ -116,18 +141,20 @@ "fieldtype": "Attach", "label": "Attach" }, + { + "fieldname": "section_break_iyjf", + "fieldtype": "Section Break" + }, { "default": "0", - "fieldname": "use_template", + "fieldname": "is_reply", "fieldtype": "Check", - "label": "Use Template" + "label": "Is Reply" }, { - "depends_on": "eval:doc.use_template == 1", - "fieldname": "template", - "fieldtype": "Link", - "label": "Template", - "options": "WhatsApp Templates" + "fieldname": "reply_to_message_id", + "fieldtype": "Data", + "label": "Reply To Message ID" }, { "fieldname": "section_break_dhba", @@ -148,42 +175,11 @@ "fieldtype": "Dynamic Link", "label": "Reference name", "options": "reference_doctype" - }, - { - "fieldname": "reply_to_message_id", - "fieldtype": "Data", - "label": "Reply To Message ID" - }, - { - "fieldname": "section_break_iyjf", - "fieldtype": "Section Break" - }, - { - "default": "0", - "fieldname": "is_reply", - "fieldtype": "Check", - "label": "Is Reply" - }, - { - "fieldname": "template_parameters", - "fieldtype": "Small Text", - "label": "Template Parameters", - "read_only": 1 - }, - { - "fieldname": "template_header_parameters", - "fieldtype": "Small Text", - "label": "Template Header Parameters", - "read_only": 1 } ], "index_web_pages_for_search": 1, "links": [], -<<<<<<< Updated upstream - "modified": "2024-04-25 16:07:48.143626", -======= - "modified": "2024-04-30 18:00:06.805534", ->>>>>>> Stashed changes + "modified": "2024-05-03 13:22:45.081391", "modified_by": "Administrator", "module": "Frappe Whatsapp", "name": "WhatsApp Message", diff --git a/frappe_whatsapp/utils/webhook.py b/frappe_whatsapp/utils/webhook.py index 2e8ed1a..48e832d 100644 --- a/frappe_whatsapp/utils/webhook.py +++ b/frappe_whatsapp/utils/webhook.py @@ -135,7 +135,7 @@ def post(): "type": "Incoming", "from": message['from'], "message_id": message['id'], - "message": message[message_type].get("location"), + "message": message[message_type].get(message_type), "content_type" : message_type }).insert(ignore_permissions=True)