Delete through .csv

Hey guys,

I think it would be pretty cool if it were possible to delete a file (such as item or BOM) using the .csv, perhaps by adding a column for delete? Not sure how it would work, but it’s just a thought.


@cpurbaugh, just run a simple python script to do this.

@rmehta I was looking for something similar, I assume the script must be run server side? How would such a script be run? I am thinking with our end users in mind, for them to be able to do it from within ERPNext. As @cpurbaugh states, adding a column with a 0 or 1 for “flag for deletion” would be great. For that import type, perhaps a final confirmation would be interesting to setup!

Bulk delete is usually a dangerous action, what is the use case?

I agree that bulk delete is a dangerous action, someone could certainly sabotage your data. Seems like deleting records straight from MariaDB would be a better option?

Not that is worse, you will lose data integrity, just use a script and call frappe.delete_doc(doctype, name)

1 Like

Server side script is more elegant for sure. The bench environment simplifies many functions by way of easy scripts. Data integrity is preserved by not allowing users to delete multiple records at once.

I have used the REST API to mass delete files - doesn’t require a server_side script and is pretty easy to do. I did an excel macro for mass Submit, Cancel and Delete.