diff options
| author | Thibault Delavallée <tde@openerp.com> | 2013-01-08 16:13:32 +0100 |
|---|---|---|
| committer | Thibault Delavallée <tde@openerp.com> | 2013-01-08 16:13:32 +0100 |
| commit | e2d4f6dac61e1c2bf9bde90fea73ffa28b615ebd (patch) | |
| tree | f00180f07f79fab36fd5e677e9ea985877aebfdf /addons | |
| parent | 06d08603cc5a09eb7e8eaa064ee572234d49fd30 (diff) | |
| parent | f91fc3b74fdb481fd71305970346457144d7d935 (diff) | |
[FIX] message_post: now handles partner_ids parameter with extra-caution, creating a set of sets. If partner_ids is a list of ids, or a list of commands under list form, this should work as well.
bzr revid: tde@openerp.com-20130108151332-q349tkjsv0fpb0hm
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/mail/mail_thread.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index cb6d5856517..6d9082d09bd 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -948,7 +948,15 @@ class mail_thread(osv.AbstractModel): partner_ids.add((4, parent_message.author_id.id)) # 1.A.3: add specified recipients - partner_ids |= set(kwargs.pop('partner_ids', [])) + param_partner_ids = set() + for item in kwargs.pop('partner_ids', []): + if isinstance(item, (list)): + param_partner_ids.add((item[0], item[1])) + elif isinstance(item, (int, long)): + param_partner_ids.add((4, item)) + else: + param_partner_ids.add(item) + partner_ids |= param_partner_ids # 1.B: handle body, message_type and message_subtype if content_subtype == 'plaintext': |
