fix: Remove cost center query from doctypes

This commit is contained in:
Deepesh Garg 2020-11-15 22:44:39 +05:30
parent 6e5748e2a3
commit f916bc048f
12 changed files with 3 additions and 106 deletions

View File

@ -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: {

View File

@ -222,15 +222,6 @@ erpnext.accounts.JournalEntry = frappe.ui.form.Controller.extend({
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];

View File

@ -46,14 +46,6 @@ frappe.ui.form.on('Loyalty Program', {
};
});
frm.set_query("cost_center", function() {
return {
filters: {
company: frm.doc.company
}
};
});
frm.set_value("company", frappe.defaults.get_user_default("Company"));
},

View File

@ -88,15 +88,6 @@ frappe.ui.form.on('Payment Entry', {
}
});
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"];

View File

@ -501,15 +501,6 @@ frappe.ui.form.on("Purchase Invoice", {
}
}
}
frm.set_query("cost_center", function() {
return {
filters: {
company: frm.doc.company,
is_group: 0
}
};
});
},
onload: function(frm) {

View File

@ -571,15 +571,6 @@ frappe.ui.form.on('Sales Invoice', {
};
});
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',

View File

@ -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: {

View File

@ -31,14 +31,6 @@ frappe.ui.form.on('Asset', {
}
};
});
frm.set_query("cost_center", function() {
return {
"filters": {
"company": frm.doc.company,
}
};
});
},
setup: function(frm) {

View File

@ -167,15 +167,6 @@ frappe.ui.form.on("Expense Claim", {
};
});
frm.set_query("cost_center", "expenses", function() {
return {
filters: {
"company": frm.doc.company,
"is_group": 0
}
};
});
frm.set_query("payable_account", function() {
return {
filters: {

View File

@ -113,14 +113,7 @@ frappe.ui.form.on('Payroll Entry', {
}
};
}),
frm.set_query("cost_center", function () {
return {
filters: {
"is_group": 0,
company: frm.doc.company
}
};
}),
frm.set_query("project", function () {
return {
filters: {

View File

@ -31,15 +31,6 @@ frappe.ui.form.on(cur_frm.doctype, {
}
}
});
frm.set_query("cost_center", "taxes", function(doc) {
return {
filters: {
'company': doc.company,
"is_group": 0
}
}
});
}
},
validate: function(frm) {

View File

@ -159,16 +159,6 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
};
});
}
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) {