[fix] [minor] validate warehouse user

This commit is contained in:
Nabin Hait 2013-10-10 19:15:58 +05:30
parent 2658384edd
commit 93c836c86d

View File

@ -209,7 +209,7 @@ def get_warehouse_list(doctype, txt, searchfield, start, page_len, filters):
return wlist return wlist
def validate_warehouse_user(warehouse): def validate_warehouse_user(warehouse):
if webnotes.session.user=="Administrator": if webnotes.session.user=="Administrator" or not warehouse:
return return
warehouse_users = [p[0] for p in webnotes.conn.sql("""select user from `tabWarehouse User` warehouse_users = [p[0] for p in webnotes.conn.sql("""select user from `tabWarehouse User`
where parent=%s""", warehouse)] where parent=%s""", warehouse)]