From 30134a2cc98ce99f0303005c5116a56e7909cb49 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Wed, 18 Jan 2023 22:10:55 +0530 Subject: [PATCH 1/2] fix: Correct standard docfield types - `creation` and `modified` are timestamps not dates. - `modified_by` is similar to `owner` so not sure why we can't have this render as link as well --- frappe/public/js/frappe/model/model.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/frappe/public/js/frappe/model/model.js b/frappe/public/js/frappe/model/model.js index 18acf00ad3..b835989c07 100644 --- a/frappe/public/js/frappe/model/model.js +++ b/frappe/public/js/frappe/model/model.js @@ -112,9 +112,14 @@ $.extend(frappe.model, { { fieldname: "name", fieldtype: "Link", label: __("ID") }, { fieldname: "owner", fieldtype: "Link", label: __("Created By"), options: "User" }, { fieldname: "idx", fieldtype: "Int", label: __("Index") }, - { fieldname: "creation", fieldtype: "Date", label: __("Created On") }, - { fieldname: "modified", fieldtype: "Date", label: __("Last Updated On") }, - { fieldname: "modified_by", fieldtype: "Data", label: __("Last Updated By") }, + { fieldname: "creation", fieldtype: "Datetime", label: __("Created On") }, + { fieldname: "modified", fieldtype: "Datetime", label: __("Last Updated On") }, + { + fieldname: "modified_by", + fieldtype: "Link", + label: __("Last Updated By"), + options: "User", + }, { fieldname: "_user_tags", fieldtype: "Data", label: __("Tags") }, { fieldname: "_liked_by", fieldtype: "Data", label: __("Liked By") }, { fieldname: "_comments", fieldtype: "Text", label: __("Comments") }, From 96afc5ebd99f31f4ea584288425e02ec8e0bad4c Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Wed, 18 Jan 2023 22:13:22 +0530 Subject: [PATCH 2/2] fix: correct invalid filters - Datetime - equality doesn't make sense because of milliseconds. A separate operator for "date" part can be useful here maybe. - Code - data like filter and remove comparison operators. - Phone - treat like Data - Barcode - treat like data - attach - treat like data - attach image - treat like data - rating - remove invalid operators - password - LOL --- frappe/public/js/frappe/ui/filters/filter.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/ui/filters/filter.js b/frappe/public/js/frappe/ui/filters/filter.js index 261b1dd5ba..96c4fd712d 100644 --- a/frappe/public/js/frappe/ui/filters/filter.js +++ b/frappe/public/js/frappe/ui/filters/filter.js @@ -39,13 +39,16 @@ frappe.ui.Filter = class { this.invalid_condition_map = { Date: ["like", "not like"], - Datetime: ["like", "not like"], + Datetime: ["like", "not like", "in", "not in", "=", "!="], Data: ["Between", "Timespan"], Select: ["like", "not like", "Between", "Timespan"], Link: ["Between", "Timespan", ">", "<", ">=", "<="], Currency: ["Between", "Timespan"], Color: ["Between", "Timespan"], Check: this.conditions.map((c) => c[0]).filter((c) => c !== "="), + Code: ["Between", "Timespan", ">", "<", ">=", "<=", "in", "not in"], + Password: ["Between", "Timespan", ">", "<", ">=", "<=", "in", "not in"], + Rating: ["like", "not like", "Between", "in", "not in", "Timespan"], }; } @@ -497,10 +500,14 @@ frappe.ui.filter_utils = { "Small Text", "Text Editor", "Code", + "Attach", + "Attach Image", "Markdown Editor", "HTML Editor", "Tag", + "Phone", "Comments", + "Barcode", "Dynamic Link", "Read Only", "Assign",