mirror of
https://github.com/frappe/erpnext.git
synced 2026-10-29 22:57:42 +00:00
fix: hide Item Price fields from users without permission (backport #51791)
Item Price fields are hidden from users who cannot write them.
(cherry picked from commit b3db2981de)
This commit is contained in:
@@ -117,6 +117,11 @@ frappe.ui.form.on("Item", {
|
||||
},
|
||||
__("View")
|
||||
);
|
||||
|
||||
frm.toggle_display(
|
||||
["opening_stock"],
|
||||
frappe.model.can_create("Stock Entry") && frappe.model.can_write("Stock Entry")
|
||||
);
|
||||
}
|
||||
|
||||
if (frm.doc.is_fixed_asset) {
|
||||
@@ -230,6 +235,8 @@ frappe.ui.form.on("Item", {
|
||||
});
|
||||
frm.set_df_property("is_fixed_asset", "read_only", frm.doc.__onload?.asset_exists ? 1 : 0);
|
||||
frm.toggle_reqd("customer", frm.doc.is_customer_provided_item ? 1 : 0);
|
||||
|
||||
frm.toggle_display(["standard_rate"], frappe.model.can_create("Item Price"));
|
||||
},
|
||||
|
||||
validate: function (frm) {
|
||||
|
||||
Reference in New Issue
Block a user