Commits

Korbinian Preisler committed 30c94a2

add name field on search_rec_name

Comments (0)

Files changed (1)

         i = 0
         while i < len(args):
             ids = self.search(cursor, user, [
-                ('bank_code', args[i][1], args[i][2]),
+                ('name', args[i][1], args[i][2]),
                 ], limit=1, context=context)
             if ids:
-                args2.append(('bank_code', args[i][1], args[i][2]))
+                args2.append(('name', args[i][1], args[i][2]))
             else:
                 ids = self.search(cursor, user, [
-                             ('bic', args[i][1], args[i][2]),
-                             ], limit=1, context=context)
+                    ('bank_code', args[i][1], args[i][2]),
+                    ], limit=1, context=context)
                 if ids:
-                    args2.append(('bic', args[i][1], args[i][2]))
+                    args2.append(('bank_code', args[i][1], args[i][2]))
                 else:
-                    args2.append((self._rec_name, args[i][1], args[i][2]))
+                    ids = self.search(cursor, user, [
+                                 ('bic', args[i][1], args[i][2]),
+                                 ], limit=1, context=context)
+                    if ids:
+                        args2.append(('bic', args[i][1], args[i][2]))
+                    else:
+                        args2.append((self._rec_name, args[i][1], args[i][2]))
             i += 1
         return args2