Skip to Content
Menu
This question has been flagged
1 Reply
8503 Views

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
Discard
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
Discard
Author

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

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

Author

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

Yes I used the same code Akhil

Author

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

Author

checked console, its showing "odoo not defined"

Related Posts Replies Views Activity
0
Apr 24
399
4
Nov 23
4246
0
Oct 23
378
0
Dec 22
1334
2
Dec 23
17351