refactor: pass config through boot

This commit is contained in:
ruthra kumar
2024-12-10 10:50:37 +05:30
parent 67b28a7864
commit 6ea9c0c48d
2 changed files with 19 additions and 21 deletions

View File

@@ -499,9 +499,7 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
item_code(doc, cdt, cdn) { item_code(doc, cdt, cdn) {
var me = this; var me = this;
// Experimental: This will be removed once stability is achieved. // Experimental: This will be removed once stability is achieved.
frappe.db.get_single_value('Selling Settings', 'use_server_side_reactivity') if (frappe.boot.sysdefaults.use_server_side_reactivity) {
.then((value) => {
if (value) {
var item = frappe.get_doc(cdt, cdn); var item = frappe.get_doc(cdt, cdn);
frappe.call({ frappe.call({
doc: doc, doc: doc,
@@ -519,9 +517,6 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
} else { } else {
me.process_item_selection(doc, cdt, cdn); me.process_item_selection(doc, cdt, cdn);
} }
});
} }
process_item_selection(doc, cdt, cdn) { process_item_selection(doc, cdt, cdn) {

View File

@@ -16,6 +16,9 @@ def boot_session(bootinfo):
bootinfo.sysdefaults.territory = frappe.db.get_single_value("Selling Settings", "territory") bootinfo.sysdefaults.territory = frappe.db.get_single_value("Selling Settings", "territory")
bootinfo.sysdefaults.customer_group = frappe.db.get_single_value("Selling Settings", "customer_group") bootinfo.sysdefaults.customer_group = frappe.db.get_single_value("Selling Settings", "customer_group")
bootinfo.sysdefaults.use_server_side_reactivity = frappe.db.get_single_value(
"Selling Settings", "use_server_side_reactivity"
)
bootinfo.sysdefaults.allow_stale = cint( bootinfo.sysdefaults.allow_stale = cint(
frappe.db.get_single_value("Accounts Settings", "allow_stale") frappe.db.get_single_value("Accounts Settings", "allow_stale")
) )