Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
9066 Переглядів

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
2185
4
лист. 23
6381
0
жовт. 23
2098
0
груд. 22
2925
2
груд. 23
19887