Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
9079 Vues

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
Ignorer
Meilleure réponse

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
Ignorer
Auteur

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

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

Auteur

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

Yes I used the same code Akhil

Auteur

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

Auteur

checked console, its showing "odoo not defined"

Publications associées Réponses Vues Activité
0
avr. 24
2197
4
nov. 23
6387
0
oct. 23
2110
0
déc. 22
2933
2
déc. 23
19904