Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

171
Vistas
Modify Crash_manager on Odoo_13

Hello guys I'm trying to modify the error window that odoo shows when an error occurs to only shows the button see details and copy to clipboard to specific user groups, I tried to change the crash_manager.xml on web module, but the changes made only can be seen when I'm in developer mode in odoo, and I don't have good knowledge in JavaScript to change the crash_manager.js but if you can give me an insight of how achieve this, you will help me a lot.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

To patch the crash_manager class, you will need to understand how Odoo manage assets.

You have to include the script in the web.assets_backend which contains the code specific to the web client.

<template id="assets_backend" name="My assets" inherit_id="web.assets_backend">
    <xpath expr="." position="inside">
        <script type="text/javascript" src="/<Module name>/static/src/js/crash_manager.js"></script>
    </xpath>
</template>

In the following code, we will define a new widget attribute visibilitythat we can use later in the template to control the visibility of the buttons:

odoo.define('<Module name>.CrashManager', function (require) {
"use strict";
    var ErrorDialog = require('web.CrashManager').ErrorDialog;
    var session = require('web.session');
    ErrorDialog.include({
        init: function (parent, options, error) {
            var self = this;
            this._super.apply(this, [parent, options, error]);
            // this.visibility = session.is_system?'visible': "hidden";
            session.user_has_group('base.group_system').then(function(has_group){
                self.visibility = has_group?'visible': "hidden";
            });
        },
    });
});

Hiding Details and Copy buttons will make the message obsolete, so you need to change it.

In the following example, we alter the CrashManager.error template to define a style attribute for the Copy the full error to clipboard and See details buttons:

<t t-extend="CrashManager.error">
    <t t-jquery="div.float-right" t-operation="attributes">
        <attribute name="t-att-style">'visibility: ' + widget.visibility</attribute>
    </t>
    <t t-jquery="button" t-operation="attributes">
        <attribute name="t-att-style">'visibility: ' + widget.visibility</attribute>
    </t>
</t>
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda