From 79d4400c160f98ebe639081c4a59668c6f134b7a Mon Sep 17 00:00:00 2001 From: Himanshu Date: Sat, 19 Jan 2019 14:01:38 +0530 Subject: [PATCH] fix: Offline pos fix (#16424) * Offline POS fix * Fixed items search and load items --- erpnext/accounts/page/pos/pos.js | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/erpnext/accounts/page/pos/pos.js b/erpnext/accounts/page/pos/pos.js index 04c8718ad9a..c89035c33f3 100755 --- a/erpnext/accounts/page/pos/pos.js +++ b/erpnext/accounts/page/pos/pos.js @@ -1135,18 +1135,15 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ }, apply_category: function() { - frappe.db.get_value("Item Group", {lft: 1, is_group: 1}, "name", (r) => { - category = this.selected_item_group || r.name; - - if(category == r.name) { - return this.item_data - } else { - return this.item_data.filter(function(element, index, array){ - return element.item_group == category; - }); - } - }) - + var me = this; + category = this.selected_item_group || "All Item Groups"; + if(category == 'All Item Groups') { + return this.item_data + } else { + return this.item_data.filter(function(element, index, array){ + return element.item_group == category; + }); + } }, bind_items_event: function() {