From 409612457ba96fe40e0fbce87a30190566568cb7 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 13 Feb 2012 18:24:14 +0530 Subject: [PATCH] error fixed in trash control --- erpnext/utilities/doctype/trash_control/trash_control.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/utilities/doctype/trash_control/trash_control.py b/erpnext/utilities/doctype/trash_control/trash_control.py index 644a27879a..228160eaaa 100644 --- a/erpnext/utilities/doctype/trash_control/trash_control.py +++ b/erpnext/utilities/doctype/trash_control/trash_control.py @@ -26,7 +26,7 @@ class DocType: # ----------- def get_masters(self): mlist = [] - res = sql("select distinct t1.name from tabDocType t1, tabDocPerm t2 where ifnull(t1.allow_trash, 0) = 1 and (ifnull(t2.write, 0) = 1 or ifnull(t2.create, 0) = 1) and t2.role in %s and t2.parent = t1.name and t1.module not in ('DocType','Application Internal','Recycle Bin','Development','Testing','Testing System','Test') ORDER BY t1.name" % cstr(tuple(webnotes.user.get_roles()))) + res = sql("select distinct t1.name from tabDocType t1, tabDocPerm t2 where ifnull(t1.allow_trash, 0) = 1 and (ifnull(t2.write, 0) = 1 or ifnull(t2.create, 0) = 1) and t2.role in (%s) and t2.parent = t1.name and t1.module not in ('DocType','Application Internal','Recycle Bin','Development','Testing','Testing System','Test') ORDER BY t1.name" % ("'"+"', '".join(webnotes.user.get_roles())+"'")) for r in res: mlist.append(r[0]) return mlist @@ -56,4 +56,4 @@ class DocType: for r in arg[k]: sql("update `tab%s` set docstatus = 0, modified = '%s', trash_reason = '' where name = '%s'" % (k, now(), r)) dt_obj = get_obj(k,r) - if hasattr(dt_obj, 'on_restore'): dt_obj.on_restore() \ No newline at end of file + if hasattr(dt_obj, 'on_restore'): dt_obj.on_restore()