diff --git a/core/doctype/doctype/doctype.py b/core/doctype/doctype/doctype.py index c6dbb1e0c4..617659971f 100644 --- a/core/doctype/doctype/doctype.py +++ b/core/doctype/doctype/doctype.py @@ -26,9 +26,6 @@ import webnotes from webnotes.utils import now, cint msgprint = webnotes.msgprint - - - class DocType: def __init__(self, doc=None, doclist=[]): self.doc = doc @@ -68,6 +65,9 @@ class DocType: msgprint('Series already in use: The series "%s" is already used in "%s"' % (prefix, used_in[0][0]), raise_exception=1) def validate(self): + for c in [".", "/", "#", "&", "=", ":", "'", '"']: + if c in self.name: + webnotes.msgprint(c + " not allowed in name", raise_exception=1) self.validate_series() self.scrub_field_names() validate_fields(filter(lambda d: d.doctype=="DocField", self.doclist)) @@ -182,7 +182,7 @@ def validate_fields_for_doctype(doctype): def validate_fields(fields): def check_illegal_characters(fieldname): for c in ['.', ',', ' ', '-', '&', '%', '=', '"', "'", '*', '$', - '(', ')', '[', ']']: + '(', ')', '[', ']', '/']: if c in fieldname: webnotes.msgprint("'%s' not allowed in fieldname (%s)" % (c, fieldname)) diff --git a/public/build.json b/public/build.json index 2678025f3c..679a367198 100644 --- a/public/build.json +++ b/public/build.json @@ -54,13 +54,10 @@ "lib/public/js/wn/provide.js", "lib/public/js/wn/assets.js", "lib/public/js/wn/dom.js", - "lib/public/js/wn/model.js", - "lib/public/js/wn/perm.js", "lib/public/js/wn/meta.js", "lib/public/js/wn/misc/user.js", "lib/public/js/wn/misc/utils.js", "lib/public/js/lib/public/json2.js", - "lib/public/js/wn/router.js", "lib/public/js/wn/ui/messages.js", "lib/public/js/wn/ui/listing.js", "lib/public/js/wn/views/container.js", @@ -79,8 +76,6 @@ "lib/public/js/wn/ui/button.js", "lib/public/js/legacy/widgets/dialog.js", "lib/public/js/legacy/webpage/loaders.js", - "lib/public/js/legacy/model/local_data.js", - "lib/public/js/legacy/model/doclist.js", "lib/public/js/wn/app.js" ] }, @@ -98,6 +93,13 @@ "lib/public/js/lib/tiny_mce_3.5.7/jquery.tinymce.js:concat", "lib/public/js/lib/mousetrap.min.js", + "lib/public/js/wn/router.js", + "lib/public/js/wn/model/model.js", + "lib/public/js/wn/model/doclist.js", + "lib/public/js/wn/model/sync.js", + "lib/public/js/wn/model/create_new.js", + "lib/public/js/wn/model/perm.js", + "lib/public/js/wn/misc/tools.js", "lib/public/js/legacy/utils/printElement.js", "lib/public/js/legacy/widgets/form/fields.js", diff --git a/public/js/legacy/globals.js b/public/js/legacy/globals.js index a211330125..a819a51180 100644 --- a/public/js/legacy/globals.js +++ b/public/js/legacy/globals.js @@ -10,6 +10,8 @@ wn.provide('_r'); wn.provide('_c'); wn.provide('_e'); wn.provide('_startup_data') +wn.provide('locals') +wn.provide('locals.DocType') // setup custom binding for history wn.settings.no_history = 1; @@ -52,6 +54,4 @@ var FILTER_SEP = '\1'; var frms={}; var cur_frm=null; var pscript = {}; -var validated = true; -var validation_message = ''; var tinymce_loaded = null; \ No newline at end of file diff --git a/public/js/legacy/model/doclist.js b/public/js/legacy/model/doclist.js deleted file mode 100644 index d5e2438198..0000000000 --- a/public/js/legacy/model/doclist.js +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) 2012 Web Notes Technologies Pvt Ltd (http://erpnext.com) -// -// MIT License (MIT) -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the "Software"), -// to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE -// OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -function compress_doclist(list) { - var kl = {}; var vl = []; var flx = {}; - for(var i=0; i1)return true; - var fl = wn.meta.docfield_list[dt]; - - if(!fl)return true; // no doctype loaded - - var all_clear = true; - var errfld = []; - for(var i=0;i