Merge pull request #25772 from deepeshgarg007/support_settings_query
fix: Check if user can read before querying Support Settings
This commit is contained in:
commit
8a82b89308
@ -9,15 +9,17 @@ frappe.ui.form.on("Issue", {
|
||||
};
|
||||
});
|
||||
|
||||
frappe.db.get_value("Support Settings", {name: "Support Settings"},
|
||||
["allow_resetting_service_level_agreement", "track_service_level_agreement"], (r) => {
|
||||
if (r && r.track_service_level_agreement == "0") {
|
||||
frm.set_df_property("service_level_section", "hidden", 1);
|
||||
}
|
||||
if (r && r.allow_resetting_service_level_agreement == "0") {
|
||||
frm.set_df_property("reset_service_level_agreement", "hidden", 1);
|
||||
}
|
||||
});
|
||||
if (frappe.model.can_read("Support Settings")) {
|
||||
frappe.db.get_value("Support Settings", {name: "Support Settings"},
|
||||
["allow_resetting_service_level_agreement", "track_service_level_agreement"], (r) => {
|
||||
if (r && r.track_service_level_agreement == "0") {
|
||||
frm.set_df_property("service_level_section", "hidden", 1);
|
||||
}
|
||||
if (r && r.allow_resetting_service_level_agreement == "0") {
|
||||
frm.set_df_property("reset_service_level_agreement", "hidden", 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (frm.doc.service_level_agreement) {
|
||||
frappe.call({
|
||||
|
Loading…
x
Reference in New Issue
Block a user