diff --git a/frappe/__version__.py b/frappe/__version__.py index 272b48e170..44be8a7bec 100644 --- a/frappe/__version__.py +++ b/frappe/__version__.py @@ -1,2 +1,2 @@ from __future__ import unicode_literals -__version__ = "5.0.7" +__version__ = "5.0.8" diff --git a/frappe/core/doctype/doctype/doctype.py b/frappe/core/doctype/doctype/doctype.py index b3842a0a77..386770e359 100644 --- a/frappe/core/doctype/doctype/doctype.py +++ b/frappe/core/doctype/doctype/doctype.py @@ -240,8 +240,13 @@ def validate_fields(meta): frappe.throw(_("Options requried for Link or Table type field {0} in row {1}").format(d.label, d.idx)) if d.options=="[Select]" or d.options==d.parent: return - if d.options != d.parent and not frappe.db.exists("DocType", d.options): - frappe.throw(_("Options must be a valid DocType for field {0} in row {1}").format(d.label, d.idx)) + if d.options != d.parent: + options = frappe.db.get_value("DocType", d.options, "name") + if not options: + frappe.throw(_("Options must be a valid DocType for field {0} in row {1}").format(d.label, d.idx)) + else: + # fix case + d.options = options def check_hidden_and_mandatory(d): if d.hidden and d.reqd and not d.default: diff --git a/frappe/hooks.py b/frappe/hooks.py index 08c883d4b6..65f922932b 100644 --- a/frappe/hooks.py +++ b/frappe/hooks.py @@ -4,7 +4,7 @@ app_title = "Frappe Framework" app_publisher = "Frappe Technologies Pvt. Ltd." app_description = "Full Stack Web Application Framework in Python" app_icon = "octicon octicon-circuit-board" -app_version = "5.0.7" +app_version = "5.0.8" app_color = "orange" app_email = "support@frappe.io" diff --git a/frappe/templates/pages/print.py b/frappe/templates/pages/print.py index 57cdb82870..57d06ef1d9 100644 --- a/frappe/templates/pages/print.py +++ b/frappe/templates/pages/print.py @@ -121,9 +121,7 @@ def validate_print_permission(doc): return for ptype in ("read", "print"): - if (not frappe.has_permission(doc.doctype, ptype, doc) - and not frappe.has_website_permission(doc.doctype, ptype, doc)): - + if not frappe.has_permission(doc.doctype, ptype, doc): raise frappe.PermissionError(_("No {0} permission").format(ptype)) def get_letter_head(doc, no_letterhead): diff --git a/setup.py b/setup.py index fc3c79abb8..53b3d08ebe 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -version = "5.0.7" +version = "5.0.8" with open("requirements.txt", "r") as f: install_requires = f.readlines()