'create(vals) -> record
Creates a new record for the model.
The new record is initialized using the values from ``vals`` and
if necessary those from :meth:`~.default_get`.
:param dict vals:
values for the model\'s fields, as a dictionary::
{\'field_name\': field_value, ...}
see :meth:`~.write` for details
:return: new record created
:raise AccessError: * if user has no create rights on the requested object
* if user tries to bypass access rules for create on the requested object
:raise ValidateError: if user tries to enter invalid value for a field that is not in selection
:raise UserError: if a loop would be created in a hierarchy of objects a result of the operation (such as setting an object as its own parent)'

@api.model
@api.returns('self', (lambda value: value.id))
def create(self, vals):

    self.check_access_rights('create')
    vals = self._add_missing_default_values(vals)
    for field in itertools.chain(MAGIC_COLUMNS, ('parent_left', 'parent_right')):
        vals.pop(field, None)
    (old_vals, new_vals, unknown) = ({}, {}, [])
    for (key, val) in vals.iteritems():
        field = self._fields.get(key)
        if field:
            if (field.store or field.inherited):
                old_vals[key] = val
            if (field.inverse and (not field.inherited)):
                new_vals[key] = val
        else:
            unknown.append(key)
    if unknown:
        _logger.warning('%s.create()    includes    unknown    fields:    %s', self._name, ',    '.join(sorted(unknown)))
    record = self.browse(self._create(old_vals))
    protected_fields = map(self._fields.get, new_vals)
    with self.env.protecting(protected_fields, record):
        record.modified((set(new_vals) - set(old_vals)))
        record._cache.update(record._convert_to_cache(new_vals))
        for key in new_vals:
            self._fields[key].determine_inverse(record)
        record.modified((set(new_vals) - set(old_vals)))
        record._validate_fields((set(new_vals) - set(old_vals)))
        if (self.env.recompute and self._context.get('recompute', True)):
            self.recompute()
    return record
