Commit a0062484 authored by Jérome Perrin's avatar Jérome Perrin

deferred_style: call report method with user language

Some report sections may be using translation.
parent 731a8116
...@@ -5,15 +5,16 @@ form = context.restrictedTraverse(form) ...@@ -5,15 +5,16 @@ form = context.restrictedTraverse(form)
request = container.REQUEST request = container.REQUEST
request.other.update(request_other) request.other.update(request_other)
if form.meta_type == 'ERP5 Report': with portal.Localizer.translationContext(localizer_language):
report_section_list = getattr(context, form.report_method)() if form.meta_type == 'ERP5 Report':
elif form.meta_type == 'ERP5 Form': report_section_list = getattr(context, form.report_method)()
report_section_list = [] elif form.meta_type == 'ERP5 Form':
for field in form.get_fields(): report_section_list = []
if field.getRecursiveTemplateField().meta_type == 'ReportBox': for field in form.get_fields():
report_section_list.extend(field.render()) if field.getRecursiveTemplateField().meta_type == 'ReportBox':
else: report_section_list.extend(field.render())
raise ValueError, 'form meta_type (%r) unknown' %(form.meta_type,) else:
raise ValueError, 'form meta_type (%r) unknown' %(form.meta_type,)
# Rebuild request_other as report section can have modify request content # Rebuild request_other as report section can have modify request content
request_other = portal.ERP5Site_filterRequestForDeferredStyle(request) request_other = portal.ERP5Site_filterRequestForDeferredStyle(request)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment