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.

18 lines
571 B

  1. # -*- coding: utf-8 -*-
  2. from openerp import api, models
  3. class MailMessage(models.Model):
  4. _inherit = 'mail.message'
  5. @api.multi
  6. def write(self, values):
  7. if values.get('needaction_partner_ids'):
  8. if not values.get('partner_ids'):
  9. values['partner_ids'] = []
  10. for triplet in values.get('needaction_partner_ids'):
  11. if triplet[0] == 6:
  12. for id in triplet[2]:
  13. values['partner_ids'].append((4, id, False))
  14. return super(MailMessage, self).write(values)