'Override to updates the document according to the email.'

@api.model
def message_new(self, msg, custom_values=None):

    if (custom_values is None):
        custom_values = {}
    defaults = {'name': msg.get('subject'), 'planned_hours': 0.0, 'partner_id': msg.get('author_id')}
    defaults.update(custom_values)
    res = super(Task, self).message_new(msg, custom_values=defaults)
    task = self.browse(res)
    email_list = task.email_split(msg)
    partner_ids = filter(None, task._find_partner_from_emails(email_list, force_create=False))
    task.message_subscribe(partner_ids)
    return res
