Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
1293 มุมมอง

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

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ส.ค. 24
1225
2
ก.ค. 24
1242
1
ก.ย. 24
2225
3
พ.ค. 24
3156
0
ก.ค. 25
285