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

I make inherit from XML view it's name 

stock_move_line_product_selector

and I make override the confirm button with new button and I add class name select_pro_btn 

and I try this code with JS to make a special code for this button 

 

odoo.define('my_module.custom_save_button', function (require) {
"use strict";

var BasicController = require('web.BasicController');
var FormController = require('web.FormController');
var core = require('web.core');

FormController.include({
renderButtons: function ($node) {
this.$buttons.on('click', '.select_pro_btn', this._onSave.bind(this));
},
_onSave: function () {
console.log('_onSave');
},
});
});


but it not working 
can any one help me 

形象
丢弃
最佳答案

try adding 

return _super.apply(this, arguments);

in your method renderButtons. it will work

形象
丢弃
编写者

still not working, I can't find the _onSave message in the console log

相关帖文 回复 查看 活动
1
8月 24
1215
2
7月 24
1230
1
9月 24
2208
3
5月 24
3139
0
7月 25
252