跳至内容
菜单
此问题已终结
2 回复
5584 查看

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){ ... }

形象
丢弃
最佳答案

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

形象
丢弃
编写者 最佳答案

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.

形象
丢弃
相关帖文 回复 查看 活动
0
12月 24
1026
0
1月 20
2917
0
6月 18
4543
0
11月 15
5016
0
3月 25
837