codacy fix
This commit is contained in:
parent
f665189ab3
commit
39097c7fbe
@ -130,14 +130,15 @@ erpnext.PurchaseAnalytics = frappe.views.TreeGridReport.extend({
|
||||
|
||||
|
||||
if(!this.data || me.item_type != me.tree_type) {
|
||||
var items;
|
||||
if(me.tree_type=='Supplier') {
|
||||
var items = frappe.report_dump.data["Supplier"];
|
||||
} if(me.tree_type=='Supplier Group') {
|
||||
var items = this.prepare_tree("Supplier", "Supplier Group");
|
||||
items = frappe.report_dump.data["Supplier"];
|
||||
} else if(me.tree_type=='Supplier Group') {
|
||||
items = this.prepare_tree("Supplier", "Supplier Group");
|
||||
} else if(me.tree_type=="Item Group") {
|
||||
var items = this.prepare_tree("Item", "Item Group");
|
||||
items = this.prepare_tree("Item", "Item Group");
|
||||
} else if(me.tree_type=="Item") {
|
||||
var items = frappe.report_dump.data["Item"];
|
||||
items = frappe.report_dump.data["Item"];
|
||||
}
|
||||
|
||||
me.item_type = me.tree_type
|
||||
|
@ -4,7 +4,7 @@
|
||||
cur_frm.cscript.refresh = function(doc) {
|
||||
cur_frm.set_intro(doc.__islocal ? "" : __("There is nothing to edit."));
|
||||
cur_frm.cscript.set_root_readonly(doc);
|
||||
}
|
||||
};
|
||||
|
||||
cur_frm.cscript.set_root_readonly = function(doc) {
|
||||
// read-only for root customer group
|
||||
@ -14,16 +14,16 @@ cur_frm.cscript.set_root_readonly = function(doc) {
|
||||
} else {
|
||||
cur_frm.set_intro(null);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//get query select Customer Group
|
||||
cur_frm.fields_dict['parent_supplier_group'].get_query = function(doc,cdt,cdn) {
|
||||
// get query select Customer Group
|
||||
cur_frm.fields_dict['parent_supplier_group'].get_query = function() {
|
||||
return {
|
||||
filters: {
|
||||
'is_group': 1
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
cur_frm.fields_dict['accounts'].grid.get_field('account').get_query = function(doc, cdt, cdn) {
|
||||
var d = locals[cdt][cdn];
|
||||
@ -33,5 +33,5 @@ cur_frm.fields_dict['accounts'].grid.get_field('account').get_query = function(d
|
||||
'company': d.company,
|
||||
"is_group": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
@ -1,3 +1,3 @@
|
||||
frappe.treeview_settings["Supplier Group"] = {
|
||||
ignore_fields:["parent_supplier_group"]
|
||||
}
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user