Guidelines

This commit is contained in:
Bertrand Chenal committed 2008-04-10 16:37:34 +02:00
1 parent fd591e9504
commit 210b3151be
1 file changed
+5 -4
+5 -4
View File
@@ -1261,10 +1261,11 @@ class ORM(object):
self.pool.get('ir.model.access').check(cursor, user, self._name,
'unlink')
cursor.execute("SELECT id FROM wkf_instance "\
"WHERE res_id IN ("+",".join(["%s" for i in ids])+") "\
"AND res_type = %s AND state != 'complete'",
(ids+[self._name]))
cursor.execute(
"SELECT id FROM wkf_instance "\
"WHERE res_id IN (" + ",".join(["%s" for i in ids]) + ") "\
"AND res_type = %s AND state != 'complete'",
(ids+[self._name]))
if cursor.rowcount != 0:
raise ExceptORM(
'UserError','You cannot delete a record with a running workflow.')