mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-14 07:01:56 +00:00
Merge pull request #55805 from mihir-kandoi/product-bundle-disabled-v16
feat(selling): surface and respect disabled Product Bundles (backport #55791)
This commit is contained in:
@@ -611,6 +611,9 @@ erpnext.buying.get_items_from_product_bundle = function (frm) {
|
||||
fieldname: "product_bundle",
|
||||
options: "Product Bundle",
|
||||
reqd: 1,
|
||||
get_query: () => {
|
||||
return { filters: { disabled: 0 } };
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldtype: "Currency",
|
||||
|
||||
@@ -65,9 +65,12 @@
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"description": "A disabled Product Bundle cannot be selected in transactions.",
|
||||
"fieldname": "disabled",
|
||||
"fieldtype": "Check",
|
||||
"label": "Disabled"
|
||||
"in_standard_filter": 1,
|
||||
"label": "Disabled",
|
||||
"no_copy": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_eonk",
|
||||
@@ -77,7 +80,7 @@
|
||||
"icon": "fa fa-sitemap",
|
||||
"idx": 1,
|
||||
"links": [],
|
||||
"modified": "2024-03-27 13:10:19.599302",
|
||||
"modified": "2026-06-10 16:00:00.000000",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Selling",
|
||||
"name": "Product Bundle",
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
// Copyright (c) 2026, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
// License: GNU General Public License v3. See license.txt
|
||||
|
||||
frappe.listview_settings["Product Bundle"] = {
|
||||
add_fields: ["disabled"],
|
||||
get_indicator(doc) {
|
||||
if (doc.disabled) {
|
||||
return [__("Disabled"), "grey", "disabled,=,1"];
|
||||
}
|
||||
return [__("Active"), "green", "disabled,=,0"];
|
||||
},
|
||||
};
|
||||
@@ -140,7 +140,7 @@ def get_items(filters):
|
||||
item.brand,
|
||||
item.stock_uom,
|
||||
)
|
||||
.where(IfNull(item.disabled, 0) == 0)
|
||||
.where((IfNull(item.disabled, 0) == 0) & (IfNull(pb.disabled, 0) == 0))
|
||||
)
|
||||
|
||||
if item_code := filters.get("item_code"):
|
||||
|
||||
Reference in New Issue
Block a user