From 489833fd35d034cee8ec4e0a1a3c74c50b882667 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 26 Feb 2015 14:59:48 +0530 Subject: [PATCH] filters and doctype fix --- frappe/core/doctype/doctype/doctype.py | 1 - frappe/public/js/frappe/ui/filters/edit_filter.html | 1 + frappe/public/js/frappe/ui/filters/filters.js | 8 +++++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/frappe/core/doctype/doctype/doctype.py b/frappe/core/doctype/doctype/doctype.py index 1b52f76dd4..7fe06afab7 100644 --- a/frappe/core/doctype/doctype/doctype.py +++ b/frappe/core/doctype/doctype/doctype.py @@ -173,7 +173,6 @@ class DocType(Document): if not (self.istable or self.issingle): make_boilerplate("test_controller.py", self) - make_boilerplate("test_records.json", self) def make_amendable(self): """If is_submittable is set, add amended_from docfields.""" diff --git a/frappe/public/js/frappe/ui/filters/edit_filter.html b/frappe/public/js/frappe/ui/filters/edit_filter.html index 7de0490d7e..4991115c7f 100644 --- a/frappe/public/js/frappe/ui/filters/edit_filter.html +++ b/frappe/public/js/frappe/ui/filters/edit_filter.html @@ -6,6 +6,7 @@ + diff --git a/frappe/public/js/frappe/ui/filters/filters.js b/frappe/public/js/frappe/ui/filters/filters.js index a011bf9968..9612324142 100644 --- a/frappe/public/js/frappe/ui/filters/filters.js +++ b/frappe/public/js/frappe/ui/filters/filters.js @@ -145,13 +145,13 @@ frappe.ui.Filter = Class.extend({ // add help for "in" codition me.$w.find('.condition').change(function() { var condition = $(this).val(); - if(in_list(["in", "like"], condition)) { + if(in_list(["in", "like", "not in"], condition)) { me.set_field(me.field.df.parent, me.field.df.fieldname, 'Data', condition); if(!me.field.desc_area) { me.field.desc_area = $('
').appendTo(me.field.wrapper); } // set description - me.field.desc_area.html((condition==="in" + me.field.desc_area.html((in_list(["in", "not in"], condition)==="in" ? __("values separated by commas") : __("use % as wildcard"))+'
'); } else { @@ -310,7 +310,9 @@ frappe.ui.Filter = Class.extend({ if ((val.length === 0) || (val.lastIndexOf("%") !== (val.length - 1))) { val = (val || "") + '%'; } - } else if(val === '%') val = ""; + } else if(in_list(["in", "not in"], this.get_condition())) { + val = $.map(val.split(","), function(v) { return strip(v); }); + } if(val === '%') val = ""; return val; },