跳至内容
菜单
此问题已终结
1 回复
9063 查看

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();
    }
}
});
});
形象
丢弃
最佳答案

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();
}
}
});


形象
丢弃
编写者

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

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

编写者

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

Yes I used the same code Akhil

编写者

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

编写者

checked console, its showing "odoo not defined"

相关帖文 回复 查看 活动
0
4月 24
2183
4
11月 23
6377
0
10月 23
2093
0
12月 22
2916
2
12月 23
19874