summaryrefslogtreecommitdiff
path: root/addons/website/controllers
diff options
context:
space:
mode:
authorChristophe Simonis <chs@openerp.com>2014-02-20 17:38:15 +0100
committerChristophe Simonis <chs@openerp.com>2014-02-20 17:38:15 +0100
commit4b72678bc74906e552ebc8cace7161901571d2c1 (patch)
treed4965fd90f45af167c6a34eec3caad111a309f12 /addons/website/controllers
parent65db3c635eea5324676c8f85d13e0058d66ce1b9 (diff)
parentd5106a4d34a9b7c52a1ecad7c65331f1fda2e231 (diff)
[MERGE] forward port of branch saas-2 up to revid 9195 chs@openerp.com-20140220154517-6y531n1mqtnfnsmr
bzr revid: chs@openerp.com-20140220163815-69sza1kclnh5mavs
Diffstat (limited to 'addons/website/controllers')
-rw-r--r--addons/website/controllers/main.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/addons/website/controllers/main.py b/addons/website/controllers/main.py
index 7bc701edde1..a39a1a73e7a 100644
--- a/addons/website/controllers/main.py
+++ b/addons/website/controllers/main.py
@@ -95,8 +95,15 @@ class Website(openerp.addons.web.controllers.main.Home):
# Edit
#------------------------------------------------------
@http.route('/website/add/<path:path>', type='http', auth="user", website=True)
- def pagenew(self, path, noredirect=False):
+ def pagenew(self, path, noredirect=False, add_menu=None):
xml_id = request.registry['website'].new_page(request.cr, request.uid, path, context=request.context)
+ if add_menu:
+ model, id = request.registry["ir.model.data"].get_object_reference(request.cr, request.uid, 'website', 'main_menu')
+ request.registry['website.menu'].create(request.cr, request.uid, {
+ 'name': path,
+ 'url': "/page/" + xml_id,
+ 'parent_id': id,
+ }, context=request.context)
url = "/page/" + xml_id
if noredirect:
return werkzeug.wrappers.Response(url, mimetype='text/plain')