perf: dont reload doc when already saving (#21869)

This commit is contained in:
Sagar Vora 2023-07-31 06:18:54 +00:00 committed by GitHub
parent d08ee0284d
commit 97eefdaa44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -149,10 +149,10 @@ $.extend(frappe.model, {
cur_frm.doc.doctype === doc.doctype &&
cur_frm.doc.name === doc.name
) {
if (data.modified !== cur_frm.doc.modified) {
if (data.modified !== cur_frm.doc.modified && !frappe.ui.form.is_saving) {
if (!cur_frm.is_dirty()) {
cur_frm.reload_doc();
} else if (!frappe.ui.form.is_saving) {
} else {
doc.__needs_refresh = true;
cur_frm.show_conflict_message();
}