Skip to Content
Menu
This question has been flagged
2 Replies
4745 Views

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
Discard
Best Answer

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
Discard
Author Best Answer

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
Discard
Related Posts Replies Views Activity
0
Dec 24
45
0
Jan 20
2405
0
Jun 18
4005
0
Nov 15
4302
1
Dec 23
700