We would like to restrict access to “Close” button and while there are 2 options
- Custom script
- Python hook
What is the recommended approach to restrict access to button access on doctype e.g. “Close” on Issue
We would like to restrict access to “Close” button and while there are 2 options
What is the recommended approach to restrict access to button access on doctype e.g. “Close” on Issue
Hi
You can restrict access via python hook.
Hi @shraddha,
could you please elaborate? We have a similar use case, where we would like to restrict access to “Cancel” on sales order based on the current date: if posting date == curdate → allow cancel, otherwise, don’t… Any code snippets?
Hi @lasalesi,
Just refer following links
https://frappe.io/docs/user/en/guides/basics/hooks
Example -
erpnext hooks.py
validate method in employee
https://github.com/frappe/erpnext/blob/develop/erpnext/hr/doctype/employee/employee.py#L214-L219