Odoo Help

2

1
2 Answers
1
Bréndou Serge Eric
2017/12/19 4:26

Thanks Suraj! I found how to do it; i'm using  web.Widget instead.

var core = require('web.core');
var Widget= require('web.Widget'); var widgetRegistry = require('web.widget_registry'); var FieldManagerMixin = require('web.FieldManagerMixin');
var MyWidget = Widget.extend(FieldManagerMixin, {
init: function (parent, model, state) {
this._super(parent); FieldManagerMixin.init.call(this); // init code here
},
start: function () {
         //codes
},
events: {
"click button.ct_button_filter": "open_search_dialog",
},
open_search_dialog: function () {
//codes...
},
display_filter: function () {
//codes...
},
});

widgetRegistry.add(
'my_widget', MyWidget
);
On the form side i call it this way <widget name="my_widget"/> 
2 Comments
sibi0229
2018/05/07 2:51

Hi guys kindly give me an information about how to call this widget in xml side with some detail information hope it will help me a lot

Rohit Pandey
2019/02/19 2:52

How can i place Odoo control pannel in custom widget @Bréndou Serge Eric

0
Suraj Shukla (suh)
2017/12/13 7:34

Hello, you can do it as follows:

var FormView = require('web.FormView');

var MyWidget = FormView.extend({

  template: "your template name",

events: {

//events here

}

//functions for widge 

});

return MyWidget;

Ask a Question
Keep Informed
1 follower(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now