From ccf370f813c920bfbd24940b5b11fdc9ddaba0d6 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 16 Jun 2014 13:50:11 +0530 Subject: [PATCH] Fixed item query --- erpnext/controllers/queries.py | 2 +- erpnext/patches.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py index a3b3ed2ffa..a4d2b52916 100644 --- a/erpnext/controllers/queries.py +++ b/erpnext/controllers/queries.py @@ -141,7 +141,7 @@ def item_query(doctype, txt, searchfield, start, page_len, filters): concat(substr(tabItem.description, 1, 40), "..."), description) as decription from tabItem where tabItem.docstatus < 2 - and (ifnull(tabItem.end_of_life, '0000-00-00') = '0000-00-00' or tabItem.end_of_life > %(today)s) + and (tabItem.end_of_life is null or tabItem.end_of_life > %(today)s) and (tabItem.`{key}` LIKE %(txt)s or tabItem.item_name LIKE %(txt)s) {fcond} {mcond} diff --git a/erpnext/patches.txt b/erpnext/patches.txt index f7342c1d75..761b63c9fd 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -60,3 +60,4 @@ erpnext.patches.v4_0.save_default_letterhead erpnext.patches.v4_0.update_custom_print_formats_for_renamed_fields erpnext.patches.v4_0.update_other_charges_in_custom_purchase_print_formats erpnext.patches.v4_0.create_price_list_if_missing +execute:frappe.db.sql("update `tabItem` set end_of_life=null where end_of_life='0000-00-00'") #2014-06-16