fix(POS): Add Product Bundles to POS item search (#25860)

This commit is contained in:
Ganga Manoj 2021-05-28 09:56:30 +05:30 committed by GitHub
parent 24f2d58f53
commit 8a776a63cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -62,7 +62,6 @@ def get_items(start, page_length, price_list, item_group, pos_profile, search_va
`tabItem` item {bin_join_selection}
WHERE
item.disabled = 0
AND item.is_stock_item = 1
AND item.has_variants = 0
AND item.is_sales_item = 1
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)
if items_data:
items_data = filter_service_items(items_data)
items = [d.item_code for d in items_data]
item_prices_data = frappe.get_all("Item Price",
fields = ["item_code", "price_list_rate", "currency"],
@ -135,6 +135,14 @@ def search_serial_or_batch_or_barcode_number(search_value):
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):
if serial_no or batch_no or barcode:
return "item.name = {0}".format(frappe.db.escape(item_code))