From b1f1596aef5e8968d22abb63f9e7bf8da72b009b Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 16 Jul 2014 16:22:34 +0200 Subject: [PATCH] [FIX] "prefetching" removing even the records specifically asked for 16d6744 turns out to not be great, because it filters out the todos for prefetched fields (rather than those just for the field being asked) there are situations where it ends up not fetching the records it was originally asked for and breaks a bunch of stuff e.g. unreconcile line in bank statements Force the ids explicitly asked for back in the fetched set, so that the prefetch is at most a noop, rco will have to take an actual look at it. --- openerp/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/models.py b/openerp/models.py index 519290327dd..7b17c366ec6 100644 --- a/openerp/models.py +++ b/openerp/models.py @@ -3182,7 +3182,7 @@ class BaseModel(object): for field in (self._fields[name] for name in field_names): prefetch.update(self._in_cache_without(field).ids) todo.update(self.env.todo.get(field, empty).ids) - records = self.browse(prefetch - todo) + records = self.browse(prefetch - todo | set(self.ids)) result = [] for sub_ids in cr.split_for_in_conditions(records.ids):