Merge pull request #21372 from shariquerik/re-delete-after-deleting-dependent-doc

This commit is contained in:
Shariq Ansari 2023-06-19 12:13:56 +05:30 committed by GitHub
commit d25d4137e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View file

@ -479,6 +479,7 @@ def delete_items():
def delete_bulk(doctype, items):
undeleted_items = []
for i, d in enumerate(items):
try:
frappe.delete_doc(doctype, d)
@ -493,7 +494,11 @@ def delete_bulk(doctype, items):
except Exception:
# rollback if any record failed to delete
# if not rollbacked, queries get committed on after_request method in app.py
undeleted_items.append(d)
frappe.db.rollback()
if undeleted_items and len(items) != len(undeleted_items):
frappe.clear_messages()
delete_bulk(doctype, undeleted_items)
@frappe.whitelist()

View file

@ -376,6 +376,7 @@ frappe.show_progress = (title, count, total = 100, description, hide_on_completi
// timeout to avoid abrupt hide
setTimeout(frappe.hide_progress, 500);
}
frappe.cur_progress.$wrapper.css("z-index", 2000);
return dialog;
};