Skip to content

Commit

Permalink
[FIX] mail: when checking for possible messages to fetch, perform
Browse files Browse the repository at this point in the history
a search_count on mail_message when the actual number of messages or their
ids is not necessary, to speedup the computation.
  • Loading branch information
tde-banana-odoo committed Aug 22, 2014
1 parent 10be954 commit 3211ff7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addons/mail/mail_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,8 @@ def _get_expandable(domain, message_nb, parent_id, max_limit):
exp_domain = domain + [('id', '<', min(message_unload_ids + message_ids))]
else:
exp_domain = domain + ['!', ('id', 'child_of', message_unload_ids + parent_tree.keys())]
ids = self.search(cr, uid, exp_domain, context=context, limit=1)
if ids:
more_count = self.search_count(cr, uid, exp_domain, context=context)
if more_count:
# inside a thread: prepend
if parent_id:
messages.insert(0, _get_expandable(exp_domain, -1, parent_id, True))
Expand Down

0 comments on commit 3211ff7

Please sign in to comment.