From 72c408c0bf30b3b80e8f6323bb3409b495185903 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 22 Jan 2016 15:24:21 +0530 Subject: [PATCH 1/3] [fix] Checkbox value on submitted form --- frappe/public/js/frappe/form/control.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/form/control.js b/frappe/public/js/frappe/form/control.js index 7c6e627f9d..5b5e93571f 100644 --- a/frappe/public/js/frappe/form/control.js +++ b/frappe/public/js/frappe/form/control.js @@ -672,7 +672,14 @@ frappe.ui.form.ControlCheck = frappe.ui.form.ControlData.extend({ set_input: function(value) { this.input.checked = value ? 1 : 0; this.last_value = value; - } + }, + get_value: function() { + if (!this.$input) { + return; + } + + return this.$input.prop("checked") ? 1 : 0; + }, }); frappe.ui.form.ControlButton = frappe.ui.form.ControlData.extend({ From 3c844c138714d8894483ffc637a52e61a2df778f Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 22 Jan 2016 15:25:12 +0530 Subject: [PATCH 2/3] [fix] Reset doctype properties if single --- frappe/core/doctype/doctype/doctype.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/frappe/core/doctype/doctype/doctype.py b/frappe/core/doctype/doctype/doctype.py index e150e84a9e..6bffb42cd3 100644 --- a/frappe/core/doctype/doctype/doctype.py +++ b/frappe/core/doctype/doctype/doctype.py @@ -37,6 +37,15 @@ class DocType(Document): for c in [".", "/", "#", "&", "=", ":", "'", '"']: if c in self.name: frappe.throw(_("{0} not allowed in name").format(c)) + + if self.issingle: + self.allow_import = 0 + self.is_submittable = 0 + self.istable = 0 + + elif self.istable: + self.allow_import = 0 + self.validate_series() self.scrub_field_names() self.validate_document_type() @@ -50,9 +59,6 @@ class DocType(Document): self.make_amendable() - if self.istable: - self.allow_import = 0 - def check_developer_mode(self): """Throw exception if not developer mode or via patch""" if frappe.flags.in_patch: @@ -298,6 +304,10 @@ def validate_fields(meta): frappe.throw(_("Precision should be between 1 and 6")) def check_unique_and_text(d): + if meta.issingle: + d.unique = 0 + d.search_index = 0 + if getattr(d, "unique", False): if d.fieldtype not in ("Data", "Link", "Read Only"): frappe.throw(_("Fieldtype {0} for {1} cannot be unique").format(d.fieldtype, d.label)) From 7784b85487495dc7b9666d25394b11e5ad27d42e Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 22 Jan 2016 15:57:12 +0600 Subject: [PATCH 3/3] bumped to version 6.19.3 --- frappe/__version__.py | 2 +- frappe/hooks.py | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frappe/__version__.py b/frappe/__version__.py index 87e007bbf7..0b09418217 100644 --- a/frappe/__version__.py +++ b/frappe/__version__.py @@ -1,2 +1,2 @@ from __future__ import unicode_literals -__version__ = "6.19.2" +__version__ = "6.19.3" diff --git a/frappe/hooks.py b/frappe/hooks.py index bb74350464..e91a5926c1 100644 --- a/frappe/hooks.py +++ b/frappe/hooks.py @@ -5,7 +5,7 @@ app_publisher = "Frappe Technologies Pvt. Ltd." app_description = "Full stack web framework with Python, Javascript, MariaDB, Redis, Node" app_icon = "octicon octicon-circuit-board" -app_version = "6.19.2" +app_version = "6.19.3" app_color = "orange" source_link = "https://github.com/frappe/frappe" app_license = "MIT" diff --git a/setup.py b/setup.py index 72ca101a24..6ffe40ff19 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup, find_packages from pip.req import parse_requirements -version = "6.19.2" +version = "6.19.3" requirements = parse_requirements("requirements.txt", session="") setup(