Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

170
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda