Commit 90c7dfa4 authored by Nicolas Delaby's avatar Nicolas Delaby

Make render_odf usable in Report Section

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24645 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 843c4d06
...@@ -390,12 +390,17 @@ class OOoChartWidget(Widget.Widget): ...@@ -390,12 +390,17 @@ class OOoChartWidget(Widget.Widget):
render_prefix=render_prefix) render_prefix=render_prefix)
def render_odf(self, field, key, value, REQUEST, render_format='ooo', render_prefix=None): def render_odf(self, field, key, value, REQUEST, render_format='ooo',
render_prefix=None):
""" """
Render a Chart for ODT Style. Render a Chart for ODT Style.
""" """
if REQUEST is None: REQUEST=get_request()
form = field.aq_parent form = field.aq_parent
here = getattr(form, 'aq_parent', REQUEST) here = getattr(form, 'aq_parent', REQUEST)
REQUEST.set('render_prefix', render_prefix)
#needed to update REQUEST
self.getArgumentDict(field, REQUEST)
content = ''' content = '''
<office:include path="%s/ERP5Site_buildChart" xlink:type="simple" xlink:actuate="onLoad" xlink:show="embed"/> <office:include path="%s/ERP5Site_buildChart" xlink:type="simple" xlink:actuate="onLoad" xlink:show="embed"/>
''' % here.getPath() ''' % here.getPath()
...@@ -419,7 +424,8 @@ class OOoChartWidget(Widget.Widget): ...@@ -419,7 +424,8 @@ class OOoChartWidget(Widget.Widget):
title = field.get_value('title') title = field.get_value('title')
alt = field.get_value('description') or title alt = field.get_value('description') or title
form = field.aq_parent form = field.aq_parent
if not render_prefix:
render_prefix = REQUEST.get('render_prefix')
# Find the applicable context # Find the applicable context
here = getattr(form, 'aq_parent', REQUEST) here = getattr(form, 'aq_parent', REQUEST)
# Update the render format based on REQUEST parameters # Update the render format based on REQUEST parameters
......
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