You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
874 B

  1. from openerp import api, models
  2. class MailMessage(models.Model):
  3. _inherit = 'mail.message'
  4. def write(self, values):
  5. if values.get('needaction_partner_ids'):
  6. if not values.get('partner_ids'):
  7. values['partner_ids'] = []
  8. for triplet in values.get('needaction_partner_ids'):
  9. if triplet[0] == 6:
  10. for id in triplet[2]:
  11. values['partner_ids'].append((4, id, False))
  12. return super(MailMessage, self).write(values)
  13. class MailComposer(models.TransientModel):
  14. _inherit = 'mail.compose.message'
  15. def send_mail(self, auto_commit=False):
  16. res = super(MailComposer, self).send_mail(auto_commit=auto_commit)
  17. notification = {}
  18. self.env['bus.bus'].sendone((self._cr.dbname, 'mail_base.mail_sent'), notification)
  19. return res