콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
9084 화면

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();
    }
}
});
});
아바타
취소
베스트 답변

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


아바타
취소
작성자

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

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

작성자

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

Yes I used the same code Akhil

작성자

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

작성자

checked console, its showing "odoo not defined"

관련 게시물 답글 화면 활동
0
4월 24
2204
4
11월 23
6401
0
10월 23
2131
0
12월 22
2948
2
12월 23
19919