Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
1312 Visualizzazioni

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 

Avatar
Abbandona
Risposta migliore

try adding 

return _super.apply(this, arguments);

in your method renderButtons. it will work

Avatar
Abbandona
Autore

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

Post correlati Risposte Visualizzazioni Attività
1
ago 24
1249
2
lug 24
1251
1
set 24
2247
3
mag 24
3175
0
lug 25
48