Merge pull request #1860 from nabinhait/v4-hotfix

item  query fixed in stock entry
This commit is contained in:
Nabin Hait 2014-06-27 13:04:58 +05:30
commit a46af033b9

View File

@ -387,7 +387,7 @@ class StockEntry(StockController):
def get_item_details(self, args):
item = frappe.db.sql("""select stock_uom, description, item_name,
expense_account, buying_cost_center from `tabItem`
where name = %s and (ifnull(end_of_life,'')='' or end_of_life > now())""",
where name = %s and (ifnull(end_of_life,'0000-00-00')='0000-00-00' or end_of_life > now())""",
(args.get('item_code')), as_dict = 1)
if not item:
frappe.throw(_("Item {0} is not active or end of life has been reached").format(args.get("item_code")))