diff --git a/product/ERP5Type/XMLMatrix.py b/product/ERP5Type/XMLMatrix.py
index 96e031460e48f4af795158a28b8c983433a837f6..baf25ffec91812cc66d9f55b588b394ad2573368 100644
--- a/product/ERP5Type/XMLMatrix.py
+++ b/product/ERP5Type/XMLMatrix.py
@@ -494,12 +494,10 @@ class XMLMatrix(Folder):
       if not self.index.has_key(cell_id):
         return None
 
-      i = 0
       base_item = self.index[base_id]
-      for my_id in kw:
+      for i, my_id in enumerate(kw):
         if base_item[i].has_key(my_id):
           cell_id += '_%s' % base_item[i][my_id]
-          i += 1
         else:
           raise KeyError, 'Invalid key: %s' % str(kw)