From f4d3f4ff601773edd481e56fd5f475ac4d12ce37 Mon Sep 17 00:00:00 2001 From: venkata akhil Date: Fri, 29 Sep 2023 14:45:01 +0530 Subject: [PATCH] QWIK changes --- .../doctype/qwik_service/qwik_service.js | 23 ++++++------------- .../doctype/qwik_service/qwik_service.py | 2 +- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/smart_service/phase_2/doctype/qwik_service/qwik_service.js b/smart_service/phase_2/doctype/qwik_service/qwik_service.js index 683cdd2..6168478 100644 --- a/smart_service/phase_2/doctype/qwik_service/qwik_service.js +++ b/smart_service/phase_2/doctype/qwik_service/qwik_service.js @@ -332,7 +332,8 @@ function custom_tab_html(frm){ // size: 'small', // small, large, extra-large primary_action_label: 'Submit', primary_action(values) { - if (values && values.level && values.content) { + if (values && values.level && values.content.length >0) { + console.log() frappe.call({ method: "smart_service.phase_2.doctype.qwik_service.qwik_service.insert_qwik_data", args: { @@ -346,24 +347,14 @@ function custom_tab_html(frm){ cur_frm.reload_doc() cur_frm.refresh() } + } }) } - var is_content =1 - if(values.content && values.content==""){ - values.content.map(v=>{ - if(values.content=="Null"){ - is_content=0 - } - }) - - } - if(is_content==1){ - values.content=="Null" - // var df = frappe.meta.get_docfield("Instructions", "content_type", cur_frm.doc.name); - // df.read_only = 1; - cur_frm.refresh_fields("values.content"); - } + if (values && values.level && values.content.length == 0){ + msgprint("content should not be empty") + frappe.validate=false; + } qwik_dia.hide(); } }); diff --git a/smart_service/phase_2/doctype/qwik_service/qwik_service.py b/smart_service/phase_2/doctype/qwik_service/qwik_service.py index 26a442b..cfb9db6 100644 --- a/smart_service/phase_2/doctype/qwik_service/qwik_service.py +++ b/smart_service/phase_2/doctype/qwik_service/qwik_service.py @@ -24,7 +24,7 @@ class QwikService(Document): self.my_id = count[0][0] + 1 else: self.my_id = 1 - if self.keywords: + if self.keywords: self.keywords=self.keywords.strip() except Exception as e: raise e