From 8860b9d94d2b672b3747409db13e1b186bba681a Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 28 May 2015 01:09:21 -0400 Subject: [PATCH] [fix] Check if company exists in re-order item. Fixes #3365. --- erpnext/stock/reorder_item.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/reorder_item.py b/erpnext/stock/reorder_item.py index cab419f3d3..f5b612c53c 100644 --- a/erpnext/stock/reorder_item.py +++ b/erpnext/stock/reorder_item.py @@ -7,7 +7,7 @@ from frappe.utils import flt, cstr, nowdate, add_days, cint def reorder_item(): """ Reorder item if stock reaches reorder level""" # if initial setup not completed, return - if not frappe.db.sql("select name from `tabFiscal Year` limit 1"): + if not (frappe.db.a_row_exists("Company") and frappe.db.a_row_exists("Fiscal Year")): return if cint(frappe.db.get_value('Stock Settings', None, 'auto_indent')): @@ -159,7 +159,7 @@ def send_email_notification(mr_list): msg += "" + item.item_code + "" + item.warehouse + "" + \ cstr(item.qty) + "" + cstr(item.uom) + "" msg += "" - frappe.sendmail(recipients=email_list, + frappe.sendmail(recipients=email_list, subject='Auto Material Request Generation Notification', message = msg) def notify_errors(exceptions_list):