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?