mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-07 12:33:19 +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"),
|
label: __("Items"),
|
||||||
fieldtype: "MultiSelectList",
|
fieldtype: "MultiSelectList",
|
||||||
options: "Item",
|
options: "Item",
|
||||||
get_data: function (txt) {
|
get_data: async function (txt) {
|
||||||
return frappe.db.get_link_options("Item", 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