Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
1277 Lượt xem

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 

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

try adding 

return _super.apply(this, arguments);

in your method renderButtons. it will work

Ảnh đại diện
Huỷ bỏ
Tác giả

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

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 8 24
1210
2
thg 7 24
1205
1
thg 9 24
2186
3
thg 5 24
3111
0
thg 7 25
176