Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
5608 Vistas

I'm trying to implement a function that takes IDs from selectable one2many field in the wizard. The only way I found on how to do it was to override(?) _onExecuteAction / execute_action via including it in ActionManager. The problem now is that other buttons are causing errors. For example Edit Attributes on Order Lines. Here's my code:


var ActionManager = require('web.ActionManager');


ActionManager.include({

    custom_events: _.extend({}, ActionManager.prototype.custom_events, {

        execute_action: '_onExecuteAction',

    }),


    _onExecuteAction: function(ev){ ... }

Avatar
Descartar
Mejor respuesta

Hi Peter,

I saw that _onExecuteAction is the default function from Odoo, please make sure the parameters inside the function are the same as default, and to call the super function, you can do something like this:

ActionManager.include({
    _onExecuteAction: function (action, options) {
        var self = this;
        var res = this._super(action, options);
        // Your custom code...
        return res;
    },
});

Regards
Ivan

Avatar
Descartar
Autor Mejor respuesta

Oh, I forgot to mention that it's for ODOO 13, so the function's arguments are different. Anyways, I've been using that _super function, but slightly differently (this._super.apply(this, arguments)), the outcome was the same though. Thanks for the response as it was reassuring! I've found where the problem was in the end thanks to it.

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
0
dic 24
1079
0
ene 20
2940
0
jun 18
4548
0
nov 15
5052
0
mar 25
865