Merge pull request #471 from odoo-dev/7.0-opw-606994-rgo
[MERGE] mail: Speed improvement, backport of rev ed116d6b6b
This commit is contained in:
commit
427d57c33a
|
@ -881,9 +881,11 @@ class mail_message(osv.Model):
|
|||
fol_ids = fol_obj.search(cr, SUPERUSER_ID, [
|
||||
('res_model', '=', message.model),
|
||||
('res_id', '=', message.res_id),
|
||||
('subtype_ids', 'in', message.subtype_id.id)
|
||||
], context=context)
|
||||
partners_to_notify |= set(fo.partner_id for fo in fol_obj.browse(cr, SUPERUSER_ID, fol_ids, context=context))
|
||||
partners_to_notify |= set(
|
||||
fo.partner_id for fo in fol_obj.browse(cr, SUPERUSER_ID, fol_ids, context=context)
|
||||
if message.subtype_id.id in [st.id for st in fo.subtype_ids]
|
||||
)
|
||||
# remove me from notified partners, unless the message is written on my own wall
|
||||
if message.author_id and message.model == "res.partner" and message.res_id == message.author_id.id:
|
||||
partners_to_notify |= set([message.author_id])
|
||||
|
|
Loading…
Reference in New Issue