I have modified a js variable function in my custom module. It works in localhost without any issue but doesn't work on server.
The code is below:
odoo.define('cof_website_big_menu.big_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;
}
});
});
It shows failed module error in the browser console. After further debugging I found following error:
TypeError: Cannot read property 'include' of undefined
at website.assets_editor.js:174
at process_job (web.assets_common.js:2994)
at Object.process_jobs (web.assets_common.js:3000)
at $.when.then.job.rejected (web.assets_common.js:2995)
at web.assets_common.js:547
at fire (web.assets_common.js:541)
at Object.add [as done] (web.assets_common.js:542)
at Array.<anonymous> (web.assets_common.js:547)
at Function.each (web.assets_common.js:370)
at Object.<anonymous> (web.assets_common.js:547)
How to solve this?