From f6f5e625505c154e3e76f7d486e5d3aeb23c2478 Mon Sep 17 00:00:00 2001 From: shridhar Date: Fri, 16 Aug 2024 10:39:46 +0530 Subject: [PATCH] fix: set template name as per meta --- .../doctype/whatsapp_templates/whatsapp_templates.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frappe_whatsapp/frappe_whatsapp/doctype/whatsapp_templates/whatsapp_templates.py b/frappe_whatsapp/frappe_whatsapp/doctype/whatsapp_templates/whatsapp_templates.py index b85437e..94a0c64 100644 --- a/frappe_whatsapp/frappe_whatsapp/doctype/whatsapp_templates/whatsapp_templates.py +++ b/frappe_whatsapp/frappe_whatsapp/doctype/whatsapp_templates/whatsapp_templates.py @@ -13,6 +13,8 @@ class WhatsAppTemplates(Document): """Create whatsapp template.""" + def autoname(self): + self.name = self.template_name.lower().replace(" ", "_") def validate(self): if not self.language_code or self.has_value_changed("language"):