projects
/
odoo
/
odoo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
10be954
)
[FIX] mail: when checking for possible messages to fetch, perform
author
Thibault Delavallée
<tde@openerp.com>
Fri, 22 Aug 2014 10:59:18 +0000
(12:59 +0200)
committer
Thibault Delavallée
<tde@openerp.com>
Fri, 22 Aug 2014 11:36:54 +0000
(13:36 +0200)
a search_count on mail_message when the actual number of messages or their
ids is not necessary, to speedup the computation.
addons/mail/mail_message.py
patch
|
blob
|
history
diff --git
a/addons/mail/mail_message.py
b/addons/mail/mail_message.py
index
6413e1c
..
2529c4b
100644
(file)
--- a/
addons/mail/mail_message.py
+++ b/
addons/mail/mail_message.py
@@
-450,8
+450,8
@@
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())]
- 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))