mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-09 00:01:18 +00:00
fix: Product Page non-stock item status (#20383)
This commit is contained in:
@@ -124,3 +124,11 @@ def get_price(item_code, price_list, customer_group, company, qty=1):
|
||||
price_obj["formatted_price"] = ""
|
||||
|
||||
return price_obj
|
||||
|
||||
def get_non_stock_item_status(item_code, item_warehouse_field):
|
||||
#if item belongs to product bundle, check if bundle items are in stock
|
||||
if frappe.db.exists("Product Bundle", item_code):
|
||||
items = frappe.get_doc("Product Bundle", item_code).get_all_children()
|
||||
return all([ get_qty_in_stock(d.item_code, item_warehouse_field).in_stock for d in items ])
|
||||
else:
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user