[minor] re-verify password before deleting company transactions
This commit is contained in:
parent
c4d38e2183
commit
ed618f284b
@ -11,6 +11,7 @@ frappe.ui.form.on("Company", {
|
|||||||
erpnext.company.set_chart_of_accounts_options(frm.doc);
|
erpnext.company.set_chart_of_accounts_options(frm.doc);
|
||||||
},
|
},
|
||||||
delete_company_transactions: function(frm) {
|
delete_company_transactions: function(frm) {
|
||||||
|
frappe.verify_password(function() {
|
||||||
var d = frappe.prompt({
|
var d = frappe.prompt({
|
||||||
fieldtype:"Data",
|
fieldtype:"Data",
|
||||||
fieldname: "company_name",
|
fieldname: "company_name",
|
||||||
@ -31,12 +32,17 @@ frappe.ui.form.on("Company", {
|
|||||||
callback: function(r, rt) {
|
callback: function(r, rt) {
|
||||||
if(!r.exc)
|
if(!r.exc)
|
||||||
frappe.msgprint(__("Successfully deleted all transactions related to this company!"));
|
frappe.msgprint(__("Successfully deleted all transactions related to this company!"));
|
||||||
|
},
|
||||||
|
onerror: function() {
|
||||||
|
frappe.msgprint(__("Wrong Password"));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}, __("Delete all the Transactions for this Company"), __("Delete"));
|
}, __("Delete all the Transactions for this Company"), __("Delete")
|
||||||
|
);
|
||||||
d.get_primary_btn().addClass("btn-danger");
|
d.get_primary_btn().addClass("btn-danger");
|
||||||
}
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user