mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-13 02:01:21 +00:00
refactor: pass config through boot
This commit is contained in:
@@ -499,29 +499,24 @@ 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) => {
|
var item = frappe.get_doc(cdt, cdn);
|
||||||
if (value) {
|
frappe.call({
|
||||||
var item = frappe.get_doc(cdt, cdn);
|
doc: doc,
|
||||||
frappe.call({
|
method: "process_item_selection",
|
||||||
doc: doc,
|
args: {
|
||||||
method: "process_item_selection",
|
item: item.name
|
||||||
args: {
|
},
|
||||||
item: item.name
|
callback: function(r) {
|
||||||
},
|
if(!r.exc) {
|
||||||
callback: function(r) {
|
cur_frm.refresh_fields();
|
||||||
if(!r.exc) {
|
refresh_field("items");
|
||||||
cur_frm.refresh_fields();
|
}
|
||||||
refresh_field("items");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
me.process_item_selection(doc, cdt, cdn);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
me.process_item_selection(doc, cdt, cdn);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
process_item_selection(doc, cdt, cdn) {
|
process_item_selection(doc, cdt, cdn) {
|
||||||
|
|||||||
@@ -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")
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user