'Function called by the js, when no google doc are yet associated with a record, with the aim to create one. It
will first seek for a google.docs.config associated with the model `res_model` to find out what\'s the template
of google doc to copy (this is usefull if you want to start with a non-empty document, a type or a name
different than the default values). If no config is associated with the `res_model`, then a blank text document
with a default name is created.
:param res_model: the object for which the google doc is created
:param ids: the list of ids of the objects for which the google doc is created. This list is supposed to have
a length of 1 element only (batch processing is not supported in the code, though nothing really prevent it)
:return: the config id and config name'

@api.model
def get_google_drive_config(self, res_model, res_id):

    if (not res_id):
        raise UserError(_('Creating    google    drive    may    only    be    done    by    one    at    a    time.'))
    configs = self.search([('model_id', '=', res_model)])
    config_values = []
    for config in configs.sudo():
        if config.filter_id:
            if (config.filter_id.user_id and (config.filter_id.user_id.id != self.env.user.id)):
                continue
            domain = ([('id', 'in', [res_id])] + safe_eval(config.filter_id.domain))
            additionnal_context = safe_eval(config.filter_id.context)
            google_doc_configs = self.env[config.filter_id.model_id].with_context(**additionnal_context).search(domain)
            if google_doc_configs:
                config_values.append({'id': config.id, 'name': config.name})
        else:
            config_values.append({'id': config.id, 'name': config.name})
    return config_values
