mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-16 16:15:02 +00:00
fix: use the item_query for get_data
(cherry picked from commit 169caaf66f)
This commit is contained in:
@@ -43,8 +43,28 @@ frappe.query_reports["Stock Ledger"] = {
|
||||
label: __("Items"),
|
||||
fieldtype: "MultiSelectList",
|
||||
options: "Item",
|
||||
get_data: function (txt) {
|
||||
return frappe.db.get_link_options("Item", txt, {});
|
||||
get_data: async function (txt) {
|
||||
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: {},
|
||||
as_dict: 1,
|
||||
},
|
||||
});
|
||||
|
||||
data = data.map(({ name, description }) => {
|
||||
return {
|
||||
value: name,
|
||||
description: description,
|
||||
};
|
||||
});
|
||||
|
||||
return data || [];
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user