From ea5a32d304c7d6a27f6c5b1c801716787d442ff1 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Wed, 10 Aug 2016 17:18:52 +0530 Subject: [PATCH 1/3] [Fix] Searial no search issue, if serial no is similar with item code --- erpnext/accounts/page/pos/pos.js | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/erpnext/accounts/page/pos/pos.js b/erpnext/accounts/page/pos/pos.js index 8444dbe91f..64168b2f4b 100644 --- a/erpnext/accounts/page/pos/pos.js +++ b/erpnext/accounts/page/pos/pos.js @@ -421,19 +421,25 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ } key = this.search.$input.val().toLowerCase(); + search_status = true if(key){ return $.grep(window.items, function(item){ - if(in_list(item.batch_nos, me.search.$input.val())){ - return me.item_batch_no[item.item_code] = me.search.$input.val() - } else if((item.item_code.toLowerCase().match(key)) || - (item.item_name.toLowerCase().match(key)) || (item.item_group.toLowerCase().match(key))){ - return true - }else if(item.barcode == me.search.$input.val()){ - return item.barcode == me.search.$input.val(); - } else if (in_list(Object.keys(item.serial_nos), me.search.$input.val())){ - me.item_serial_no[item.item_code] = [me.search.$input.val(), item.serial_nos[me.search.$input.val()]] - return true + if(search_status){ + if(in_list(item.batch_nos, me.search.$input.val())){ + search_status = false; + return me.item_batch_no[item.item_code] = me.search.$input.val() + } else if(in_list(Object.keys(item.serial_nos), me.search.$input.val())) { + search_status = false; + me.item_serial_no[item.item_code] = [me.search.$input.val(), item.serial_nos[me.search.$input.val()]] + return true + } else if(item.barcode == me.search.$input.val()) { + search_status = false; + return item.barcode == me.search.$input.val(); + } else if((item.item_code.toLowerCase().match(key)) || + (item.item_name.toLowerCase().match(key)) || (item.item_group.toLowerCase().match(key))) { + return true + } } }) }else{ From 36f2d4f81e4bd9fec55e583341f143cbd92776be Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 10 Aug 2016 19:45:59 +0530 Subject: [PATCH 2/3] [fix] patch for schools; --- erpnext/patches/v7_0/migrate_schools_to_erpnext.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/erpnext/patches/v7_0/migrate_schools_to_erpnext.py b/erpnext/patches/v7_0/migrate_schools_to_erpnext.py index 695f6ccbcd..80e9eac896 100644 --- a/erpnext/patches/v7_0/migrate_schools_to_erpnext.py +++ b/erpnext/patches/v7_0/migrate_schools_to_erpnext.py @@ -1,5 +1,5 @@ from __future__ import unicode_literals -import frappe +import frappe, os def execute(): reload_doctypes_for_schools_icons() @@ -21,5 +21,7 @@ def execute(): remove_from_installed_apps("schools") def reload_doctypes_for_schools_icons(): - for d in frappe.get_all('DocType', filters={'module': 'Schools'}): - frappe.reload_doc('schools', 'doctype', frappe.scrub(d.name)) + base_path = frappe.get_app_path('erpnext', 'schools', 'doctype') + for doctype in os.listdir(base_path): + if os.path.exists(os.path.join(base_path, doctype, doctype + '.json')): + frappe.reload_doc('schools', 'doctype', doctype) From cf80f850bd18020631f32cd2c8e30a0fe223cf59 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 10 Aug 2016 20:17:23 +0600 Subject: [PATCH 3/3] bumped to version 7.0.26 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index c6fd27d4f7..97b7c373af 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals import frappe -__version__ = '7.0.25' +__version__ = '7.0.26' def get_default_company(user=None): '''Get default company for user'''