mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-07 20:42:50 +00:00
fix: update get_data function to use item_query
(cherry picked from commit 8a97b39028)
This commit is contained in:
@@ -40,7 +40,7 @@ frappe.query_reports["Stock Balance"] = {
|
|||||||
fieldtype: "MultiSelectList",
|
fieldtype: "MultiSelectList",
|
||||||
width: "80",
|
width: "80",
|
||||||
options: "Item",
|
options: "Item",
|
||||||
get_data: function (txt) {
|
get_data: async function (txt) {
|
||||||
let item_group = frappe.query_report.get_filter_value("item_group");
|
let item_group = frappe.query_report.get_filter_value("item_group");
|
||||||
|
|
||||||
let filters = {
|
let filters = {
|
||||||
@@ -48,7 +48,27 @@ frappe.query_reports["Stock Balance"] = {
|
|||||||
is_stock_item: 1,
|
is_stock_item: 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
return frappe.db.get_link_options("Item", txt, filters);
|
let { message: data } = await frappe.call({
|
||||||
|
method: "erpnext.controllers.queries.item_query",
|
||||||
|
args: {
|
||||||
|
doctype: "Item",
|
||||||
|
txt: txt,
|
||||||
|
searchfield: "name",
|
||||||
|
start: 0,
|
||||||
|
page_len: 10,
|
||||||
|
filters: filters,
|
||||||
|
as_dict: 1,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
data = data.map(({ name, description }) => {
|
||||||
|
return {
|
||||||
|
value: name,
|
||||||
|
description: description,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
return data || [];
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user