Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
2 Antworten
5559 Ansichten

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
Verwerfen
Beste Antwort

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
Verwerfen
Autor Beste Antwort

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
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
0
Dez. 24
981
0
Jan. 20
2901
0
Juni 18
4533
0
Nov. 15
4991
0
März 25
797