Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
9081 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona
Autore

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

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

Autore

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

Yes I used the same code Akhil

Autore

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

Autore

checked console, its showing "odoo not defined"

Post correlati Risposte Visualizzazioni Attività
0
apr 24
2198
4
nov 23
6391
0
ott 23
2115
0
dic 22
2940
2
dic 23
19907