Use Property Setter, it is better approach.
2 Likes
you can check hidden checkbox in customize form
there is a promt message “you cannot set default fields to hidden or read only”
Add a Property Setter for default field with needed change details
Create Property Setter:
1. Direct:
2. Code:
frappe.make_property_setter(
{
"doctype": "Sales Invoice Item",
"fieldname": "price_list_rate",
"property": "read_only",
"property_type": "Check",
"value": "0",
},
validate_fields_for_doctype=False,
)
Result:
Note: In Customization Form it is not allowed.
1 Like