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

Friends, I tried to disable create option in calendar view by inheriting the js like this, but its giving me the above Odoo client error:

odoo.define('module_name.calendar_view_id', function (require) {
"use strict";

var calenderView = require('web_calendar.CalendarView');
    calenderView.include({
    open_quick_create: function(){
    if (this.model != 'model.name') {
        this._super();
    }
}
});
});
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

I have tested the same function and its working. Not throwing any error

var calenderView = require('web_calendar.CalendarView');
calenderView.include({
open_quick_create: function(){
console.log(this)
if (this.model != 'calendar.event') {
this._super();
}
}
});


Ảnh đại diện
Huỷ bỏ
Tác giả

Hilar, whether the first two lines "odoo.define('module_name.calendar_view_id', function (require) {

"use strict";" also included in your code?

Tác giả

Am getting this error, only when I put this code in my js file

Yes I used the same code Akhil

Tác giả

Hilar, what is the syntax for odoo.define(). I mean, "module_name.calendar_view_id" is correct or not?

Tác giả

checked console, its showing "odoo not defined"

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 4 24
2191
4
thg 11 23
6384
0
thg 10 23
2103
0
thg 12 22
2928
2
thg 12 23
19894