'Track updated values. Comparing the initial and current values of
the fields given in tracked_fields, it generates a message containing
the updated values. This message can be linked to a mail.message.subtype
given by the ``_track_subtype`` method.'

@api.multi
def message_track(self, tracked_fields, initial_values):

    if (not tracked_fields):
        return True
    tracking = self._message_track_get_changes(tracked_fields, initial_values)
    for record in self:
        (changes, tracking_value_ids) = tracking[record.id]
        if (not changes):
            continue
        subtype_xmlid = False
        if (not self._context.get('mail_track_log_only')):
            subtype_xmlid = record._track_subtype(dict(((col_name, initial_values[record.id][col_name]) for col_name in changes)))
        if subtype_xmlid:
            subtype_rec = self.env.ref(subtype_xmlid)
            if (not (subtype_rec and subtype_rec.exists())):
                _logger.debug(('subtype    %s    not    found' % subtype_xmlid))
                continue
            record.message_post(subtype=subtype_xmlid, tracking_value_ids=tracking_value_ids)
        elif tracking_value_ids:
            record.message_post(tracking_value_ids=tracking_value_ids)
    self._message_track_post_template(tracking)
    return True
