'Returns a defaults-like dict with initial values for the composition
wizard when sending an email related a previous email (parent_id) or
a document (model, res_id). This is based on previously computed default
values.'

@api.model
def get_record_data(self, values):

    (result, subject) = ({}, False)
    if values.get('parent_id'):
        parent = self.env['mail.message'].browse(values.get('parent_id'))
        result['record_name'] = (parent.record_name,)
        subject = tools.ustr((parent.subject or parent.record_name or ''))
        if (not values.get('model')):
            result['model'] = parent.model
        if (not values.get('res_id')):
            result['res_id'] = parent.res_id
        partner_ids = (values.get('partner_ids', list()) + [(4, id) for id in parent.partner_ids.ids])
        if (self._context.get('is_private') and parent.author_id):
            partner_ids += [(4, parent.author_id.id)]
        result['partner_ids'] = partner_ids
    elif (values.get('model') and values.get('res_id')):
        doc_name_get = self.env[values.get('model')].browse(values.get('res_id')).name_get()
        result['record_name'] = ((doc_name_get and doc_name_get[0][1]) or '')
        subject = tools.ustr(result['record_name'])
    re_prefix = _('Re:')
    if (subject and (not (subject.startswith('Re:') or subject.startswith(re_prefix)))):
        subject = ('%s    %s' % (re_prefix, subject))
    result['subject'] = subject
    return result
