From 8dc5f240a91e3cd2e622408fceca76fba9d83dc4 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Tue, 6 May 2014 18:33:34 +0200 Subject: [PATCH] [REM] Removed addons.web#html_template usage bzr revid: fme@openerp.com-20140506163334-x94pz9bau4a0r0lb --- addons/calendar/controllers/main.py | 11 ++--------- addons/edi/controllers/main.py | 14 ++------------ addons/point_of_sale/controllers/main.py | 2 +- 3 files changed, 5 insertions(+), 22 deletions(-) diff --git a/addons/calendar/controllers/main.py b/addons/calendar/controllers/main.py index cb191912c8a..7480c85d629 100644 --- a/addons/calendar/controllers/main.py +++ b/addons/calendar/controllers/main.py @@ -48,15 +48,8 @@ class meeting_invitation(http.Controller): if attendee: attendee_data['current_attendee'] = attendee[0] - css = '' - js = '' - - return webmain.html_template % { - 'js': js, - 'css': css, - 'modules': simplejson.dumps(webmain.module_boot(db)), - 'init': "s.calendar.event('%s', '%s', '%s', '%s' , '%s');" % (db, action, id, 'form', json.dumps(attendee_data)), - } + values = dict(init="s.calendar.event('%s', '%s', '%s', '%s' , '%s');" % (db, action, id, 'form', json.dumps(attendee_data))) + return request.render('web.webclient_bootstrap', values) # Function used, in RPC to check every 5 minutes, if notification to do for an event or not @http.route('/calendar/notify', type='json', auth="none") diff --git a/addons/edi/controllers/main.py b/addons/edi/controllers/main.py index 9714083e843..5cad8f7bbc2 100644 --- a/addons/edi/controllers/main.py +++ b/addons/edi/controllers/main.py @@ -1,4 +1,3 @@ -import simplejson import werkzeug.urls import openerp @@ -10,21 +9,12 @@ class EDI(openerp.http.Controller): def import_url(self, url): # http://hostname:8069/edi/import_url?url=URIEncodedURL req = openerp.http.request - modules = webmain.module_boot(req) + ['edi'] - modules_str = ','.join(modules) - modules_json = simplejson.dumps(modules) - css = '' - js = '' # `url` may contain a full URL with a valid query string, we basically want to watch out for XML brackets and double-quotes safe_url = werkzeug.url_quote_plus(url,':/?&;=') - return webmain.html_template % { - 'js': js, - 'css': css, - 'modules': modules_json, - 'init': 's.edi.edi_import("%s");' % safe_url, - } + values = dict(init='s.edi.edi_import("%s");' % safe_url) + return req.render('web.webclient_bootstrap', values) @openerp.http.route('/edi/import_edi_url', type='json', auth='none') def import_edi_url(self, url): diff --git a/addons/point_of_sale/controllers/main.py b/addons/point_of_sale/controllers/main.py index 376ab4478b2..3cd10993d07 100644 --- a/addons/point_of_sale/controllers/main.py +++ b/addons/point_of_sale/controllers/main.py @@ -8,7 +8,7 @@ import random from openerp import http from openerp.http import request -from openerp.addons.web.controllers.main import manifest_list, module_boot, html_template, login_redirect +from openerp.addons.web.controllers.main import module_boot, login_redirect _logger = logging.getLogger(__name__)