'_check_global_default(dict, list(dict), dict) -> None
Checks if there is a global default for the model_id requested.
If there is, and the default is different than the record being written
(-> we\'re not updating the current global default), raise an error
to avoid users unknowingly overwriting existing global defaults (they
have to explicitly remove the current default before setting a new one)
This method should only be called if ``vals`` is trying to set
``is_default``
:raises odoo.exceptions.UserError: if there is an existing default and
we\'re not updating it'

@api.model
def _check_global_default(self, vals, matching_filters):

    domain = self._get_action_domain(vals.get('action_id'))
    defaults = self.search((domain + [('model_id', '=', vals['model_id']), ('user_id', '=', False), ('is_default', '=', True)]))
    if (not defaults):
        return
    if (matching_filters and (matching_filters[0]['id'] == defaults.id)):
        return
    raise UserError((_('There    is    already    a    shared    filter    set    as    default    for    %(model)s,    delete    or    change    it    before    setting    a    new    default') % {'model': vals.get('model_id')}))
