'Returns dict of write() values for synchronizing ``fields``'

@api.multi
def _update_fields_values(self, fields):

    values = {}
    for fname in fields:
        field = self._fields[fname]
        if (field.type == 'many2one'):
            values[fname] = self[fname].id
        elif (field.type == 'one2many'):
            raise AssertionError(_('One2Many    fields    cannot    be    synchronized    as    part    of    `commercial_fields`    or    `address    fields`'))
        elif (field.type == 'many2many'):
            values[fname] = [(6, 0, self[fname].ids)]
        else:
            values[fname] = self[fname]
    return values
