fix: changed enable edit select option to disable edit checkbox

This commit is contained in:
root 2024-08-15 14:33:13 +05:30 committed by Akhil Narang
parent 0b9df2b994
commit 65db85d559
No known key found for this signature in database
GPG key ID: 9DCC61E211BF645F
3 changed files with 10 additions and 11 deletions

View file

@ -10,7 +10,7 @@
"disable_comment_count",
"disable_sidebar_stats",
"disable_auto_refresh",
"enable_edit",
"disable_edit",
"total_fields",
"fields_html",
"fields"
@ -59,14 +59,14 @@
"label": "Disable Comment Count"
},
{
"fieldname": "enable_edit",
"fieldtype": "Select",
"label": "Enable Edit",
"options": "\nYes\nNo"
"default": "0",
"fieldname": "disable_edit",
"fieldtype": "Check",
"label": "Disable Edit"
}
],
"links": [],
"modified": "2024-08-14 21:11:08.307688",
"modified": "2024-08-15 14:23:18.226666",
"modified_by": "Administrator",
"module": "Desk",
"name": "List View Settings",

View file

@ -17,8 +17,8 @@ class ListViewSettings(Document):
disable_auto_refresh: DF.Check
disable_comment_count: DF.Check
disable_count: DF.Check
disable_edit: DF.Check
disable_sidebar_stats: DF.Check
enable_edit: DF.Literal["", "Yes", "No"]
fields: DF.Code | None
total_fields: DF.Literal["", "4", "5", "6", "7", "8", "9", "10"]
# end: auto-generated types

View file

@ -1898,12 +1898,11 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList {
const is_bulk_editable = (doctype) => {
if (
this.list_view_settings &&
this.list_view_settings.enable_edit &&
this.list_view_settings.enable_edit!=''
this.list_view_settings.disable_edit!=undefined
) {
return this.list_view_settings.enable_edit=='Yes'?true:false;
return !this.list_view_settings.disable_edit;
}
return !frappe.model.has_workflow(doctype);
return !frappe.model.has_workflow(doctype)
};
// utility