Odoo Help


How to extend website.editor.Dialog in frontend

Evans Bernier
on 6/20/16, 4:10 PM 1,235 views


I would like to add a popup dialog on frontend on button click. Something like option "Edit Menu" in website editor. When we click on it, a popup dialog appear and let us organize website menu. I saw that this functionality extend the website.editor.Dialog in JS like that:

    website.contentMenu.EditMenuDialog = website.editor.Dialog.extend({
        template: 'website.contentMenu.dialog.edit',
events: _.extend({}, website.editor.Dialog.prototype.events, {
'click a.js_add_menu': 'add_menu',
'click button.js_edit_menu': 'edit_menu',
'click button.js_delete_menu': 'delete_menu',

This code is available in /server/addons/website/static/src/js/website.contentMenu.js

I tried to extend website.editor.Dialog in my custom module to use the default popup dialog form, but I get this error when my page is loaded:

TypeError: website.editor is undefined

This is a part of my code:

    website.manageVideo.Dialog = website.editor.Dialog.extend({
template: 'custom_moduloe.manageVideo.dialog.edit',
events: _.extend({}, website.editor.Dialog.prototype.events, {
'click a.js_add_video': 'add_video',
'click button.js_edit_video': 'edit_video',
'click button.js_delete_video': 'delete_video',

website.ready().done(function() {
var content = new website.manageVideo.Dialog();

My templates are created and it should be working.

So, how can I create a popup dialog?


please provide your js file... have you added var website = require('website.website'); ?

Jérémy Kersten (jke)
on 6/20/16, 7:36 PM
Evans Bernier
On 6/20/16, 8:25 PM

I am using Odoo8. I added "var website = openerp.website;" on the top of my function. I think that "var website = require('website.website'); is for odoo 9.

This is the my JS file :


This is almost identical of JS function of "edit menu" from Odoo. I tried to use this code as a base.

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 6/20/16, 4:10 PM
Seen: 1235 times
Last updated: 6/20/16, 8:25 PM