Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
9061 Ansichten

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
Verwerfen
Beste Antwort

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
Verwerfen
Autor

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

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

Autor

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

Yes I used the same code Akhil

Autor

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

Autor

checked console, its showing "odoo not defined"

Verknüpfte Beiträge Antworten Ansichten Aktivität
0
Apr. 24
2183
4
Nov. 23
6377
0
Okt. 23
2093
0
Dez. 22
2916
2
Dez. 23
19874