[FIX] mail: Mail message performance improvement
As of version 8.0, search_count method has been implemented Usage in this place is not needed though, as we just need to know if there are messages in domain, not the exact number of them. Due to that we replace method search_count with search and add a limit of 1, which provides better performances. Fixes #6670 Closes #6679
This commit is contained in:
parent
bdc4c5a55e
commit
859eb2511e
|
@ -452,7 +452,7 @@ class mail_message(osv.Model):
|
|||
exp_domain = domain + [('id', '<', min(message_unload_ids + message_ids))]
|
||||
else:
|
||||
exp_domain = domain + ['!', ('id', 'child_of', message_unload_ids + parent_tree.keys())]
|
||||
more_count = self.search_count(cr, uid, exp_domain, context=context)
|
||||
more_count = self.search(cr, uid, exp_domain, context=context, limit=1)
|
||||
if more_count:
|
||||
# inside a thread: prepend
|
||||
if parent_id:
|
||||
|
|
Loading…
Reference in New Issue