From 2810d6fdab68fa1e37c5b2ff101b648cc5c3034e Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 4 Aug 2016 11:03:57 +0530 Subject: [PATCH] [minor] set default script_type for Custom Script --- frappe/custom/doctype/custom_script/custom_script.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frappe/custom/doctype/custom_script/custom_script.py b/frappe/custom/doctype/custom_script/custom_script.py index e9d59ed46b..d3f5c100c6 100644 --- a/frappe/custom/doctype/custom_script/custom_script.py +++ b/frappe/custom/doctype/custom_script/custom_script.py @@ -1,19 +1,19 @@ # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors -# MIT License. See license.txt +# MIT License. See license.txt from __future__ import unicode_literals import frappe -from frappe.utils import cstr from frappe.model.document import Document class CustomScript(Document): - def autoname(self): + if not self.script_type: + self.script_type = 'Client' self.name = self.dt + "-" + self.script_type def on_update(self): frappe.clear_cache(doctype=self.dt) - + def on_trash(self): frappe.clear_cache(doctype=self.dt)