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 <ankushmenat@gmail.com>
This commit is contained in:
RitvikSardana 2024-01-12 17:41:21 +05:30 committed by GitHub
parent 87d0b8ba1a
commit 1666b0104f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 1 deletions

View file

@ -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)

View file

@ -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";