Merge pull request #19657 from ankush/invalid_filters

fix(UX): invalid filters, incorrect std fieldtypes
This commit is contained in:
Ankush Menat 2023-01-19 22:07:50 +05:30 committed by GitHub
commit 40d0c8aaaf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 4 deletions

View file

@ -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") },

View file

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