From 63adb6763848f8540259463a5f8913e605be276e Mon Sep 17 00:00:00 2001 From: Simon Lejeune Date: Wed, 11 Jun 2014 16:56:54 +0200 Subject: [PATCH 01/29] [FIX] fixes #204 : correct report translations by 'cloning' web.layout and website.layout (inherit in primary mode) to avoid constantly synchronise website and website_report + do not wrongly update the context and loose the selected lang --- addons/report/controllers/main.py | 7 +- addons/report/views/layouts.xml | 76 +++++++--------- addons/website_report/views/layouts.xml | 116 +++++++----------------- 3 files changed, 68 insertions(+), 131 deletions(-) diff --git a/addons/report/controllers/main.py b/addons/report/controllers/main.py index c6bc13d38f8..01992d64c60 100644 --- a/addons/report/controllers/main.py +++ b/addons/report/controllers/main.py @@ -50,7 +50,12 @@ class ReportController(Controller): if data.get('options'): options_data = simplejson.loads(data['options']) if data.get('context'): - context.update(simplejson.loads(data['context'])) + # Ignore 'lang' here, because the context in data is the one from the webclient *but* if + # the user explicitely wants to change the lang, this mechanism overwrites it. + data_context = simplejson.loads(data['context']) + if data_context.get('lang'): + del data_context['lang'] + context.update(data_context) if converter == 'html': html = report_obj.get_html(cr, uid, docids, reportname, data=options_data, context=context) diff --git a/addons/report/views/layouts.xml b/addons/report/views/layouts.xml index f9c0ea7ef73..4de6717a47d 100644 --- a/addons/report/views/layouts.xml +++ b/addons/report/views/layouts.xml @@ -1,55 +1,41 @@ -