mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-13 09:43:49 +00:00
[docs] custom script examples, [build] move CMS make to app via event_handlers.on_build
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
---
|
||||
{
|
||||
"_label": "Restrict Cancel Rights based on Certain Order Value"
|
||||
}
|
||||
---
|
||||
Add a handler to `custom_before_cancel` event:
|
||||
|
||||
cur_frm.cscript.custom_before_cancel = function(doc) {
|
||||
if (user_roles.indexOf("Accounts User")!=-1 && user_roles.indexOf("Accounts Manager")==-1
|
||||
&& user_roles.indexOf("System Manager")==-1) {
|
||||
if (flt(doc.grand_total) > 10000) {
|
||||
msgprint("You can not cancel this transaction, because grand total \
|
||||
is greater than 10000");
|
||||
validated = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user