In ERPNext, customers are stored in a DocType named “Customer”.
Let’s say we have many customers in our database.
But we want to delete the one with name = “CUST-0005”.
I would write my function exactly like this:
frappe.delete_doc("Customer", "CUST-0005")
That Python function would look like this in SQL:
DELETE FROM `tabCustomer`
WHERE name = 'CUST-0005'
Hopefully this makes more sense now.
There is a DocType in the Frappe App named “ToDo” (representing a list of things ‘to do’). Many of the official Test Scripts and Examples are written about this “ToDo” document. I don’t know why it was chosen.
I did this frappe.delete_doc() from a custom button in a custom doctype and call it via frappe.call
But I get Not permitted error popup. I add the ignore_permissions and/or ignore_missing` but still the same error.
In the browser console returns:
Failed to load resource: the server responded with a status of 403 (FORBIDDEN)