diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 209b53575a5..ed28731154d 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -1132,12 +1132,7 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe if (this.frm.doc.set_posting_time) return; if (frappe.datetime.get_today() == this.frm.doc.posting_date) return; - let is_confirmation_reqd = await frappe.db.get_single_value( - "Accounts Settings", - "confirm_before_resetting_posting_date" - ); - - if (!is_confirmation_reqd) return; + if (!frappe.boot.sysdefaults.confirm_before_resetting_posting_date) return; return new Promise((resolve, reject) => { frappe.confirm( diff --git a/erpnext/startup/boot.py b/erpnext/startup/boot.py index ca9fbfc3884..0f7bb991f99 100644 --- a/erpnext/startup/boot.py +++ b/erpnext/startup/boot.py @@ -27,6 +27,9 @@ def boot_session(bootinfo): bootinfo.sysdefaults.disable_include_dimensions = cint( frappe.get_single_value("Accounts Settings", "disable_include_dimensions") ) + bootinfo.sysdefaults.confirm_before_resetting_posting_date = cint( + frappe.get_single_value("Accounts Settings", "confirm_before_resetting_posting_date") + ) bootinfo.sysdefaults.quotation_valid_till = cint( frappe.db.get_single_value("CRM Settings", "default_valid_till")