From 8f6d3d9a11be048cdda6077cb5ad984be5deeb34 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 26 Oct 2016 17:37:17 +0530 Subject: [PATCH] [fix] in_standard_filter should be in docfield, not doctype --- frappe/data/Framework.sql | 2 +- frappe/model/base_document.py | 5 +++-- frappe/public/css/filter_dashboard.css | 3 +++ .../public/js/frappe/ui/filters/filter_dashboard_head.html | 4 ++-- frappe/public/less/filter_dashboard.less | 4 ++++ 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/frappe/data/Framework.sql b/frappe/data/Framework.sql index 920661d9e9..d1d089d359 100644 --- a/frappe/data/Framework.sql +++ b/frappe/data/Framework.sql @@ -47,6 +47,7 @@ CREATE TABLE `tabDocField` ( `description` text, `in_filter` int(1) NOT NULL DEFAULT 0, `in_list_view` int(1) NOT NULL DEFAULT 0, + `in_standard_filter` int(1) NOT NULL DEFAULT 0, `read_only` int(1) NOT NULL DEFAULT 0, `precision` varchar(255) DEFAULT NULL, `length` int(11) NOT NULL DEFAULT 0, @@ -152,7 +153,6 @@ CREATE TABLE `tabDocType` ( `_user_tags` varchar(255) DEFAULT NULL, `custom` int(1) NOT NULL DEFAULT 0, `beta` int(1) NOT NULL DEFAULT 0, - `in_standard_filter` int(1) NOT NULL DEFAULT 0, `image_view` int(1) NOT NULL DEFAULT 0, PRIMARY KEY (`name`), KEY `parent` (`parent`) diff --git a/frappe/model/base_document.py b/frappe/model/base_document.py index fdef97540f..4121a9ec46 100644 --- a/frappe/model/base_document.py +++ b/frappe/model/base_document.py @@ -191,9 +191,9 @@ class BaseDocument(object): if df: if df.fieldtype=="Check": if d[fieldname]==None: - d[fieldname] = df.get('default') or 0 + d[fieldname] = 0 - if (not isinstance(d[fieldname], int) or d[fieldname] > 1): + elif (not isinstance(d[fieldname], int) or d[fieldname] > 1): d[fieldname] = 1 if cint(d[fieldname]) else 0 elif df.fieldtype=="Int" and not isinstance(d[fieldname], int): @@ -285,6 +285,7 @@ class BaseDocument(object): self.created_by = self.modifield_by = frappe.session.user d = self.get_valid_dict() + columns = d.keys() try: frappe.db.sql("""insert into `tab{doctype}` diff --git a/frappe/public/css/filter_dashboard.css b/frappe/public/css/filter_dashboard.css index 0e84a978cc..eaa206de54 100644 --- a/frappe/public/css/filter_dashboard.css +++ b/frappe/public/css/filter_dashboard.css @@ -28,6 +28,9 @@ .filter-header .sort-dropdown { margin-top: -20px; } +.filter-header .dropdown-menu { + min-width: 150px !important; +} .filter-label { margin: 0px; padding: 5px; diff --git a/frappe/public/js/frappe/ui/filters/filter_dashboard_head.html b/frappe/public/js/frappe/ui/filters/filter_dashboard_head.html index 6c59df98ef..4322661461 100644 --- a/frappe/public/js/frappe/ui/filters/filter_dashboard_head.html +++ b/frappe/public/js/frappe/ui/filters/filter_dashboard_head.html @@ -6,9 +6,9 @@ style="margin-right: 25px;"> - diff --git a/frappe/public/less/filter_dashboard.less b/frappe/public/less/filter_dashboard.less index 63ec600332..819fea98f8 100644 --- a/frappe/public/less/filter_dashboard.less +++ b/frappe/public/less/filter_dashboard.less @@ -35,6 +35,10 @@ .sort-dropdown { margin-top: -20px; } + + .dropdown-menu { + min-width: 150px !important; + } } .filter-label {