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

I am using odoo 11 and I as trying to make a custom js module containing the definition of a custom widget.

The official documentation at https://www.odoo.com/documentation/11.0/howtos/web.html is admittedly outdated and little of its content seems to be working in odoo 11.

By trial and error I managed to define the following js file, which at least does not appear to break as soon as it's loaded:

odoo.define('openacademy.test', function(require)
{
"use strict";
var Widget = require('web.Widget');
var MyWidget = Widget.extend({
start: function() {
this.$el.append("<div>I am lost in the woods</div>");
}
});
});


If my understanding is correct, this should simply define a widget containing a simple html line and nothing else.

What should I do in order to insert this thing somewhere in a page? The way defined in the official docs does not seem to work on odoo11...

Thank you very much.


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 10 18
3569
0
thg 3 22
3502
1
thg 7 24
1789
1
thg 7 23
4257
0
thg 3 24
3255