fix: Remove cost center query from doctypes
diff --git a/erpnext/accounts/doctype/budget/budget.js b/erpnext/accounts/doctype/budget/budget.js
index cadf1e7..48cc493 100644
--- a/erpnext/accounts/doctype/budget/budget.js
+++ b/erpnext/accounts/doctype/budget/budget.js
@@ -3,14 +3,6 @@
frappe.ui.form.on('Budget', {
onload: function(frm) {
- frm.set_query("cost_center", function() {
- return {
- filters: {
- company: frm.doc.company
- }
- }
- })
-
frm.set_query("project", function() {
return {
filters: {
@@ -18,7 +10,7 @@
}
}
})
-
+
frm.set_query("account", "accounts", function() {
return {
filters: {
@@ -28,7 +20,7 @@
}
}
})
-
+
frm.set_query("monthly_distribution", function() {
return {
filters: {
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.js b/erpnext/accounts/doctype/journal_entry/journal_entry.js
index ff12967..d60a7b7 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.js
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.js
@@ -222,15 +222,6 @@
return erpnext.journal_entry.account_query(me.frm);
});
- me.frm.set_query("cost_center", "accounts", function(doc, cdt, cdn) {
- return {
- filters: {
- company: me.frm.doc.company,
- is_group: 0
- }
- };
- });
-
me.frm.set_query("party_type", "accounts", function(doc, cdt, cdn) {
const row = locals[cdt][cdn];
diff --git a/erpnext/accounts/doctype/loyalty_program/loyalty_program.js b/erpnext/accounts/doctype/loyalty_program/loyalty_program.js
index 524a671..0d2b8cb 100644
--- a/erpnext/accounts/doctype/loyalty_program/loyalty_program.js
+++ b/erpnext/accounts/doctype/loyalty_program/loyalty_program.js
@@ -46,14 +46,6 @@
};
});
- frm.set_query("cost_center", function() {
- return {
- filters: {
- company: frm.doc.company
- }
- };
- });
-
frm.set_value("company", frappe.defaults.get_user_default("Company"));
},
diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.js b/erpnext/accounts/doctype/payment_entry/payment_entry.js
index e117471..ea5487d 100644
--- a/erpnext/accounts/doctype/payment_entry/payment_entry.js
+++ b/erpnext/accounts/doctype/payment_entry/payment_entry.js
@@ -88,15 +88,6 @@
}
});
- frm.set_query("cost_center", "deductions", function() {
- return {
- filters: {
- "is_group": 0,
- "company": frm.doc.company
- }
- }
- });
-
frm.set_query("reference_doctype", "references", function() {
if (frm.doc.party_type=="Customer") {
var doctypes = ["Sales Order", "Sales Invoice", "Journal Entry", "Dunning"];
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
index 1d41d0f..3c07ee7 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
@@ -501,15 +501,6 @@
}
}
}
-
- frm.set_query("cost_center", function() {
- return {
- filters: {
- company: frm.doc.company,
- is_group: 0
- }
- };
- });
},
onload: function(frm) {
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
index 502e65e..e27bd2f 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
@@ -571,15 +571,6 @@
};
});
- frm.set_query("cost_center", function() {
- return {
- filters: {
- company: frm.doc.company,
- is_group: 0
- }
- };
- });
-
frm.custom_make_buttons = {
'Delivery Note': 'Delivery',
'Sales Invoice': 'Sales Return',
diff --git a/erpnext/accounts/doctype/shipping_rule/shipping_rule.js b/erpnext/accounts/doctype/shipping_rule/shipping_rule.js
index d0904ee..7cfbfed 100644
--- a/erpnext/accounts/doctype/shipping_rule/shipping_rule.js
+++ b/erpnext/accounts/doctype/shipping_rule/shipping_rule.js
@@ -3,14 +3,6 @@
frappe.ui.form.on('Shipping Rule', {
refresh: function(frm) {
- frm.set_query("cost_center", function() {
- return {
- filters: {
- company: frm.doc.company
- }
- }
- })
-
frm.set_query("account", function() {
return {
filters: {
diff --git a/erpnext/assets/doctype/asset/asset.js b/erpnext/assets/doctype/asset/asset.js
index 7ad164a..3af3948 100644
--- a/erpnext/assets/doctype/asset/asset.js
+++ b/erpnext/assets/doctype/asset/asset.js
@@ -31,14 +31,6 @@
}
};
});
-
- frm.set_query("cost_center", function() {
- return {
- "filters": {
- "company": frm.doc.company,
- }
- };
- });
},
setup: function(frm) {
diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.js b/erpnext/hr/doctype/expense_claim/expense_claim.js
index 221300b..cbafd7d 100644
--- a/erpnext/hr/doctype/expense_claim/expense_claim.js
+++ b/erpnext/hr/doctype/expense_claim/expense_claim.js
@@ -167,15 +167,6 @@
};
});
- frm.set_query("cost_center", "expenses", function() {
- return {
- filters: {
- "company": frm.doc.company,
- "is_group": 0
- }
- };
- });
-
frm.set_query("payable_account", function() {
return {
filters: {
diff --git a/erpnext/payroll/doctype/payroll_entry/payroll_entry.js b/erpnext/payroll/doctype/payroll_entry/payroll_entry.js
index 1abc869..9600615 100644
--- a/erpnext/payroll/doctype/payroll_entry/payroll_entry.js
+++ b/erpnext/payroll/doctype/payroll_entry/payroll_entry.js
@@ -113,14 +113,7 @@
}
};
}),
- frm.set_query("cost_center", function () {
- return {
- filters: {
- "is_group": 0,
- company: frm.doc.company
- }
- };
- }),
+
frm.set_query("project", function () {
return {
filters: {
diff --git a/erpnext/public/js/controllers/accounts.js b/erpnext/public/js/controllers/accounts.js
index 6e97d81..45c494e 100644
--- a/erpnext/public/js/controllers/accounts.js
+++ b/erpnext/public/js/controllers/accounts.js
@@ -31,15 +31,6 @@
}
}
});
-
- frm.set_query("cost_center", "taxes", function(doc) {
- return {
- filters: {
- 'company': doc.company,
- "is_group": 0
- }
- }
- });
}
},
validate: function(frm) {
diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js
index 1358a4b..ec6b3dc 100644
--- a/erpnext/public/js/controllers/transaction.js
+++ b/erpnext/public/js/controllers/transaction.js
@@ -159,16 +159,6 @@
};
});
}
- if (this.frm.fields_dict["items"].grid.get_field("cost_center")) {
- this.frm.set_query("cost_center", "items", function(doc) {
- return {
- filters: {
- "company": doc.company,
- "is_group": 0
- }
- };
- });
- }
if (this.frm.fields_dict["items"].grid.get_field("expense_account")) {
this.frm.set_query("expense_account", "items", function(doc) {