跳至内容
菜单
此问题已终结
614 查看

Hello,


I have button that calls an action in python, from there I want to call JS in the frontend .

I tried client action, but it changes the view, I don't want that.


def some_button(self):

return {

'type': 'ir.actions.client',

'tag': 'some_action',

}


odoo.define('mymodule.some_action', function (require) {

"use strict";

const AbstractAction = require('web.AbstractAction');

const core = require('web.core');

const SomeAction = AbstractAction.extend({

start() {

console.log("SomeAction!");

return Promise.resolve();

}

});

core.action_registry.add('some_action', SomeAction);

});


Thank you!

形象
丢弃
相关帖文 回复 查看 活动
1
5月 25
748
2
5月 25
1229
1
5月 25
633
0
3月 25
772
0
1月 25
675