Commit 80c5d95d authored by Vincent Pelletier's avatar Vincent Pelletier

erp5_ods_style: Add support for percent-style rendering of FloatFields.

Use the same detection scheme as Formulator.
Extends a bit further rampant code duplication.
parent 03a6b159
......@@ -168,10 +168,11 @@
<tal:block tal:condition="python: field is not None">\n
<tal:block tal:condition="python:field.meta_type in [\'FloatField\',\'IntegerField\'] or (field.meta_type == \'ProxyField\' and field.getRecursiveTemplateField().meta_type in [\'FloatField\',\'IntegerField\'])">\n
<tal:block tal:define="precision python: (field.meta_type == \'FloatField\' or (field.meta_type == \'ProxyField\' and field.getRecursiveTemplateField().meta_type == \'FloatField\')) and field.get_value(\'precision\') or 0;\n
figure_style_name string:${style_prefix}figure_${precision}">\n
figure_style_name string:${style_prefix}figure_${precision};\n
input_style python: (field.meta_type == \'FloatField\' or (field.meta_type == \'ProxyField\' and field.getRecursiveTemplateField().meta_type == \'FloatField\')) and field.get_value(\'input_style\') or \'\'">\n
<table:table-cell tal:attributes="office:value value;\n
table:style-name figure_style_name"\n
office:value-type="float"\n
table:style-name figure_style_name;\n
office:value-type python: (\'%\' in input_style) and \'percentage\' or \'float\'"\n
table:style-name="figure">\n
<text:p tal:content="python: field.render_pdf(value)" />\n
</table:table-cell>\n
......
257
\ No newline at end of file
258
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