fix: condition in other bundle utils
This commit is contained in:
parent
67f43d37df
commit
8bdb61cb87
@ -556,7 +556,7 @@ def get_stock_availability(item_code, warehouse):
|
|||||||
return bin_qty - pos_sales_qty, is_stock_item
|
return bin_qty - pos_sales_qty, is_stock_item
|
||||||
else:
|
else:
|
||||||
is_stock_item = True
|
is_stock_item = True
|
||||||
if frappe.db.exists("Product Bundle", item_code):
|
if frappe.db.exists("Product Bundle", {"name": item_code, "disabled": 0}):
|
||||||
return get_bundle_availability(item_code, warehouse), is_stock_item
|
return get_bundle_availability(item_code, warehouse), is_stock_item
|
||||||
else:
|
else:
|
||||||
is_stock_item = False
|
is_stock_item = False
|
||||||
|
@ -688,7 +688,9 @@ def make_material_request(source_name, target_doc=None):
|
|||||||
"Sales Order Item": {
|
"Sales Order Item": {
|
||||||
"doctype": "Material Request Item",
|
"doctype": "Material Request Item",
|
||||||
"field_map": {"name": "sales_order_item", "parent": "sales_order"},
|
"field_map": {"name": "sales_order_item", "parent": "sales_order"},
|
||||||
"condition": lambda item: not frappe.db.exists("Product Bundle", item.item_code)
|
"condition": lambda item: not frappe.db.exists(
|
||||||
|
"Product Bundle", {"name": item.item_code, "disabled": 0}
|
||||||
|
)
|
||||||
and get_remaining_qty(item) > 0,
|
and get_remaining_qty(item) > 0,
|
||||||
"postprocess": update_item,
|
"postprocess": update_item,
|
||||||
},
|
},
|
||||||
@ -1309,7 +1311,7 @@ def set_delivery_date(items, sales_order):
|
|||||||
|
|
||||||
|
|
||||||
def is_product_bundle(item_code):
|
def is_product_bundle(item_code):
|
||||||
return frappe.db.exists("Product Bundle", item_code)
|
return frappe.db.exists("Product Bundle", {"name": item_code, "disabled": 0})
|
||||||
|
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
@ -1521,7 +1523,7 @@ def get_work_order_items(sales_order, for_raw_material_request=0):
|
|||||||
product_bundle_parents = [
|
product_bundle_parents = [
|
||||||
pb.new_item_code
|
pb.new_item_code
|
||||||
for pb in frappe.get_all(
|
for pb in frappe.get_all(
|
||||||
"Product Bundle", {"new_item_code": ["in", item_codes]}, ["new_item_code"]
|
"Product Bundle", {"new_item_code": ["in", item_codes], "disabled": 0}, ["new_item_code"]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ def remove_standard_fields(details):
|
|||||||
|
|
||||||
|
|
||||||
def set_valuation_rate(out, args):
|
def set_valuation_rate(out, args):
|
||||||
if frappe.db.exists("Product Bundle", args.item_code, cache=True):
|
if frappe.db.exists("Product Bundle", {"name": args.item_code, "disabled": 0}, cache=True):
|
||||||
valuation_rate = 0.0
|
valuation_rate = 0.0
|
||||||
bundled_items = frappe.get_doc("Product Bundle", args.item_code)
|
bundled_items = frappe.get_doc("Product Bundle", args.item_code)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user