mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-18 17:15:04 +00:00
Co-authored-by: Patrick Eißler <77415730+PatrickDEissler@users.noreply.github.com> Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
This commit is contained in:
@@ -1274,7 +1274,7 @@ def get_children(parent=None, is_root=False, **filters):
|
|||||||
|
|
||||||
bom_items = frappe.get_all(
|
bom_items = frappe.get_all(
|
||||||
"BOM Item",
|
"BOM Item",
|
||||||
fields=["item_code", "bom_no as value", "stock_qty"],
|
fields=["item_code", "bom_no as value", "stock_qty", "qty"],
|
||||||
filters=[["parent", "=", frappe.form_dict.parent]],
|
filters=[["parent", "=", frappe.form_dict.parent]],
|
||||||
order_by="idx",
|
order_by="idx",
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -16,7 +16,14 @@ frappe.treeview_settings["BOM"] = {
|
|||||||
show_expand_all: false,
|
show_expand_all: false,
|
||||||
get_label: function (node) {
|
get_label: function (node) {
|
||||||
if (node.data.qty) {
|
if (node.data.qty) {
|
||||||
return node.data.qty + " x " + node.data.item_code;
|
const escape = frappe.utils.escape_html;
|
||||||
|
let label = escape(node.data.item_code);
|
||||||
|
if (node.data.item_name && node.data.item_code !== node.data.item_name) {
|
||||||
|
label += `: ${escape(node.data.item_name)}`;
|
||||||
|
}
|
||||||
|
return `${label} <span class="badge badge-pill badge-light">${node.data.qty} ${escape(
|
||||||
|
__(node.data.stock_uom)
|
||||||
|
)}</span>`;
|
||||||
} else {
|
} else {
|
||||||
return node.data.item_code || node.data.value;
|
return node.data.item_code || node.data.value;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user