[MERGE]
[odoo/odoo.git] / addons / mrp / mrp.py
index 56edccd..850e12a 100644 (file)
@@ -215,9 +215,9 @@ class mrp_bom(osv.osv):
     ]
 
     def _check_recursion(self, cr, uid, ids):
-        level = 500
+        level = 100
         while len(ids):
-            cr.execute('select distinct bom_id from mrp_bom where id in ('+','.join(map(str, ids))+')')
+            cr.execute('select distinct bom_id from mrp_bom where id =ANY(%s)',(ids,))
             ids = filter(None, map(lambda x:x[0], cr.fetchall()))
             if not level:
                 return False