From 1666b0104f571a7f0ee4860c681544891789471b Mon Sep 17 00:00:00 2001 From: RitvikSardana <65544983+RitvikSardana@users.noreply.github.com> Date: Fri, 12 Jan 2024 17:41:21 +0530 Subject: [PATCH] fix: convert status field data to String before guessing the style (#24226) * fix: status field should only be of type 'Select'/'Data'/'Check' * chore: change code position * fix: convert status field data to string to handle all cases * chore: use cstr --------- Co-authored-by: Ankush Menat --- frappe/core/doctype/doctype/doctype.py | 1 - frappe/public/js/frappe/utils/utils.js | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/core/doctype/doctype/doctype.py b/frappe/core/doctype/doctype/doctype.py index 3c3008ecd6..73c9fda5dc 100644 --- a/frappe/core/doctype/doctype/doctype.py +++ b/frappe/core/doctype/doctype/doctype.py @@ -204,7 +204,6 @@ class DocType(Document): self.validate_document_type() validate_fields(self) self.check_indexing_for_dashboard_links() - if not self.istable: validate_permissions(self) diff --git a/frappe/public/js/frappe/utils/utils.js b/frappe/public/js/frappe/utils/utils.js index 4531304a47..18f93ab187 100644 --- a/frappe/public/js/frappe/utils/utils.js +++ b/frappe/public/js/frappe/utils/utils.js @@ -480,6 +480,7 @@ Object.assign(frappe.utils, { var style = default_style || "default"; var colour = "gray"; if (text) { + text = cstr(text); if (has_words(["Pending", "Review", "Medium", "Not Approved"], text)) { style = "warning"; colour = "orange";