Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
9060 Представления

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"

Related Posts Ответы Просмотры Активность
0
апр. 24
2182
4
нояб. 23
6376
0
окт. 23
2091
0
дек. 22
2912
2
дек. 23
19874