From 39cfc5865ed720b513cfde3f35637c720c66864a Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 30 Oct 2012 12:54:13 +0530 Subject: [PATCH] reorder level fixes --- stock/doctype/bin/bin.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stock/doctype/bin/bin.py b/stock/doctype/bin/bin.py index d8bc3830ba..8d21a5c83b 100644 --- a/stock/doctype/bin/bin.py +++ b/stock/doctype/bin/bin.py @@ -355,12 +355,12 @@ class DocType: """ Notify user about auto creation of indent""" from webnotes.utils.email_lib import sendmail - email_list=[d[0] for d in sql("""select parent from tabUserRole - where role in ('Purchase Manager','Material Manager') - and parent not in ('Administrator', 'All', 'Guest')""")] + email_list=[d[0] for d in sql("""select distinct r.parent from tabUserRole r, tabProfile p + where p.name = r.parent and p.enabled = 1 and p.docstatus < 2 + and r.role in ('Purchase Manager','Material Manager') + and p.name not in ('Administrator', 'All', 'Guest')""")] msg="""A Purchase Request has been raised for item %s: %s on %s """ % (doc_type, doc_name, nowdate()) - sendmail(email_list, subject='Auto Purchase Request Generation Notification', msg = msg) def validate(self):