[IMP] event: chatter on registration proposes to add
authorThibault Delavallée <tde@openerp.com>
Mon, 17 Nov 2014 12:45:20 +0000 (13:45 +0100)
committerThibault Delavallée <tde@openerp.com>
Mon, 17 Nov 2014 13:09:33 +0000 (14:09 +0100)
the partner and attendee email as followers.

addons/event/event.py

index adce860..3d07fcc 100644 (file)
@@ -325,3 +325,13 @@ class event_registration(models.Model):
                 self.name = self.name or contact.name
                 self.email = self.email or contact.email
                 self.phone = self.phone or contact.phone
+
+    @api.multi
+    def message_get_suggested_recipients(self):
+        recipients = super(event_registration, self).message_get_suggested_recipients()
+        for attendee in self:
+            if attendee.email:
+                self._message_add_suggested_recipient(recipients, attendee, email=attendee.email, reason=_('Customer Email'))
+            if attendee.partner_id:
+                self._message_add_suggested_recipient(recipients, attendee, partner=attendee.partner_id, reason=_('Customer'))
+        return recipients