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

Hi,

I want to add custom events to the calendar module, but I'm having hard time to understand how  odoo js framework works. How I'm supposed to extend CalendarModel ?

I created the following file my_module/static/src/js/views/calendar/my_calendar_model.and I try to show a simple alert


odoo.define('my_module.CalendarModel', function (require) {
    "use strict"

var CalendarModel = require('web.CalendarModel')

return CalendarModel.extend({
    /**
     * @override 
     */
    init: function () {
        this._super.apply(this, arguments)
        alert('test from my  module')
    }

})
});


The file is loaded but nothing happen.


Any clue about this ?


Regards

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

Ok I manage to make it works :


odoo.define('es.CalendarModel', function (require) {
    "use strict"

var CalendarModel = require('web.CalendarModel')

CalendarModel.include({
    init: function () {
        this._super.apply(this, arguments)
        alert('test from my  module')
    }

})
});




Ảnh đại diện
Huỷ bỏ

Hi, I wanted to extend functionality in calendar view of our model. In which appointments are booked on their specified date. I wanted to add hyperlink on dates, Upon click on date, user needs to redirect to kanban or listview from calendar applied by that clicked date filter. Can you help me please.

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 2 20
3890
0
thg 3 15
7491
1
thg 10 22
7459
0
thg 7 20
3281
4
thg 7 24
10903