Merge pull request #20432 from shariquerik/avoid-list-refresh-fix

This commit is contained in:
Shariq Ansari 2023-03-23 18:12:18 +05:30 committed by GitHub
commit 806df53222
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View file

@ -54,12 +54,8 @@ context("List View", () => {
method: "POST",
url: "api/method/frappe.model.workflow.bulk_workflow_approval",
}).as("bulk-approval");
cy.intercept({
method: "POST",
url: "api/method/frappe.desk.reportview.get",
}).as("real-time-update");
cy.wrap(elements).contains("Approve").click();
cy.wait(["@bulk-approval", "@real-time-update"]);
cy.wait("@bulk-approval");
cy.wait(300);
cy.get_open_dialog().find(".btn-modal-close").click();
cy.reload();

View file

@ -1339,6 +1339,11 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList {
return;
}
// if some bulk operation is happening by selecting list items, don't refresh
if (this.$checks && this.$checks.length) {
return;
}
if (!frappe.get_doc(data?.doctype, data?.name)?.__unsaved) {
frappe.model.remove_from_locals(data.doctype, data.name);
}