mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-20 21:49:18 +00:00
fix(POS): Add Product Bundles to POS item search (#25860)
This commit is contained in:
@@ -62,7 +62,6 @@ def get_items(start, page_length, price_list, item_group, pos_profile, search_va
|
|||||||
`tabItem` item {bin_join_selection}
|
`tabItem` item {bin_join_selection}
|
||||||
WHERE
|
WHERE
|
||||||
item.disabled = 0
|
item.disabled = 0
|
||||||
AND item.is_stock_item = 1
|
|
||||||
AND item.has_variants = 0
|
AND item.has_variants = 0
|
||||||
AND item.is_sales_item = 1
|
AND item.is_sales_item = 1
|
||||||
AND item.is_fixed_asset = 0
|
AND item.is_fixed_asset = 0
|
||||||
@@ -84,6 +83,7 @@ def get_items(start, page_length, price_list, item_group, pos_profile, search_va
|
|||||||
), {'warehouse': warehouse}, as_dict=1)
|
), {'warehouse': warehouse}, as_dict=1)
|
||||||
|
|
||||||
if items_data:
|
if items_data:
|
||||||
|
items_data = filter_service_items(items_data)
|
||||||
items = [d.item_code for d in items_data]
|
items = [d.item_code for d in items_data]
|
||||||
item_prices_data = frappe.get_all("Item Price",
|
item_prices_data = frappe.get_all("Item Price",
|
||||||
fields = ["item_code", "price_list_rate", "currency"],
|
fields = ["item_code", "price_list_rate", "currency"],
|
||||||
@@ -135,6 +135,14 @@ def search_serial_or_batch_or_barcode_number(search_value):
|
|||||||
|
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
|
def filter_service_items(items):
|
||||||
|
for item in items:
|
||||||
|
if not item['is_stock_item']:
|
||||||
|
if not frappe.db.exists('Product Bundle', item['item_code']):
|
||||||
|
items.remove(item)
|
||||||
|
|
||||||
|
return items
|
||||||
|
|
||||||
def get_conditions(item_code, serial_no, batch_no, barcode):
|
def get_conditions(item_code, serial_no, batch_no, barcode):
|
||||||
if serial_no or batch_no or barcode:
|
if serial_no or batch_no or barcode:
|
||||||
return "item.name = {0}".format(frappe.db.escape(item_code))
|
return "item.name = {0}".format(frappe.db.escape(item_code))
|
||||||
|
|||||||
Reference in New Issue
Block a user