تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
9080 أدوات العرض

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
أبريل 24
2197
4
نوفمبر 23
6387
0
أكتوبر 23
2110
0
ديسمبر 22
2933
2
ديسمبر 23
19904