Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
9086 Prikazi

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();
    }
}
});
});
Avatar
Opusti
Best Answer

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


Avatar
Opusti
Avtor

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

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

Avtor

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

Yes I used the same code Akhil

Avtor

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

Avtor

checked console, its showing "odoo not defined"

Related Posts Odgovori Prikazi Aktivnost
0
apr. 24
2211
4
nov. 23
6410
0
okt. 23
2138
0
dec. 22
2952
2
dec. 23
19927