'Record the creation of a many2many for this model, to make it possible
to delete it later when the module is uninstalled.'

@api.model_cr
def _save_relation_table(self, relation_table, module):

    cr = self._cr
    cr.execute('\n                                                SELECT    1    FROM    ir_model_relation,    ir_module_module\n                                                WHERE    ir_model_relation.module=ir_module_module.id\n                                                                AND    ir_model_relation.name=%s\n                                                                AND    ir_module_module.name=%s\n                                                ', (relation_table, module))
    if (not cr.rowcount):
        cr.execute("INSERT    INTO    ir_model_relation    (name,    date_init,    date_update,    module,    model)\n                                                                                                                                    VALUES    (%s,    now()    AT    TIME    ZONE    'UTC',    now()    AT    TIME    ZONE    'UTC',\n                                                                                (SELECT    id    FROM    ir_module_module    WHERE    name=%s),\n                                                                                (SELECT    id    FROM    ir_model    WHERE    model=%s))", (relation_table, module, self._name))
        self.invalidate_cache()
