Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
6522 Lượt xem

I have inherited js code in my custom module, the code is below:.


odoo.define('website_custom_menu.menu_custom', function (require) {
    'use strict';
    var EditMenuDialog = require('website.contentMenu').EditMenuDialog;
    EditMenuDialog.include({
        start: function () {
            var r = this._super.apply(this, arguments);
            this.$('.oe_menu_editor').nestedSortable({
                listType: 'ul',
                handle: 'div',
                items: 'li',
                maxLevels: 3,
                toleranceElement: '> div',
                forcePlaceholderSize: true,
                opacity: 0.6,
                placeholder: 'oe_menu_placeholder',
                tolerance: 'pointer',
                attribute: 'data-menu-id',
                expression: '()(.+)', // nestedSortable takes the second match of an expression (*sigh*)
            });
            return r;
        }
    });
});


But when I run this it says failed module and after further debugging, I found the following error:

TypeError: Cannot read property 'include' of undefined


How can I solve this?

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 8 18
6724
5
thg 2 24
24182
0
thg 7 18
2666
2
thg 7 18
3070
0
thg 12 17
4036