Commit 92b3e065 authored by Nicolas Delaby's avatar Nicolas Delaby

Render odg_view must not fallback on render_odt as nodes are different in ODT and ODG.

DateTimeWidget.render_odg_view consist into transform DateTime value into string
then call default render_odg_view renderer with casted value.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@40521 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 69a10af9
...@@ -1490,15 +1490,16 @@ class DateTimeWidget(Widget): ...@@ -1490,15 +1490,16 @@ class DateTimeWidget(Widget):
return etree.tostring(text_node) return etree.tostring(text_node)
return text_node return text_node
def render_odg(self, field, value, as_string, ooo_builder, REQUEST, def render_odg_view(self, field, value, as_string, ooo_builder, REQUEST,
render_prefix, attr_dict, local_name): render_prefix, attr_dict, local_name):
"""Transform DateTime into string then call default renderer
""" """
Return a field value rendered in odt format. if not value and field.get_value('default_now'):
- as_string return value as string or as xml object value = DateTime()
- attr_dict can be used for additional attributes (like style). value_as_text = self.format_value(field, value, mode='pdf').decode('utf-8')
""" return Widget.render_odg_view(self, field, value_as_text, as_string,
return self.render_odt(field, value, as_string, ooo_builder, REQUEST, ooo_builder, REQUEST, render_prefix,
render_prefix, attr_dict, local_name) attr_dict, local_name)
DateTimeWidgetInstance = DateTimeWidget() DateTimeWidgetInstance = DateTimeWidget()
......
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