Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
5527 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Autor Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
0
pro 24
951
0
led 20
2883
0
čvn 18
4524
0
lis 15
4936
0
bře 25
744