Merge pull request #21372 from shariquerik/re-delete-after-deleting-dependent-doc
This commit is contained in:
commit
d25d4137e2
2 changed files with 6 additions and 0 deletions
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue