Reviewers: ,


Please review this at http://codereview.tryton.org/47001/

Affected files:
  M trytond/model/browse.py


Index: trytond/model/browse.py
===================================================================

--- a/trytond/model/browse.py
+++ b/trytond/model/browse.py
@@ -150,16 +150,11 @@
                 ffields[field.datetime_field] = datetime_field

         def filter_(id_):
-            return True
-            if (id_ in self._local_data
-                    and name in self._local_data[id_]):
-                return False
-            if id_ in self._data and name in self._data[id_]:
-                return False
-            return True
-        index = self._ids.index(self.id)
-        ids = list(islice(ifilter(filter_, chain(self._ids, self._ids)),
-            index, self._cursor.IN_MAX + index))
+            return (name not in self._local_data.get(id_, {})
+                and name not in self._data.get(id_, {}))
+        to_fetch = filter(filter_, self._ids)
+        index = to_fetch.index(self.id)
+        ids = to_fetch[index:index + self._cursor.IN_MAX]
         model2ids = {}
         model2cache = {}
         # read the data



--
[email protected] mailing list

Reply via email to