Commit 22b8be3f authored by Łukasz Nowak's avatar Łukasz Nowak

- added possibility to use IntegerField in ODS representation, defaulting precision to 0

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25319 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0f9b595c
......@@ -109,30 +109,32 @@
<tal:block tal:condition="python: isinstance(value, float)">\n
<tal:block tal:define="field python: editable_fields.get(column_id, None)">\n
<tal:block tal:condition="python: field is not None">\n
<tal:block tal:condition="python:field.meta_type==\'FloatField\' or (field.meta_type == \'ProxyField\' and field.getRecursiveTemplateField().meta_type == \'FloatField\')">\n
<tal:block tal:condition="python:field.get_value(\'precision\')>0">\n
<table:table-cell tal:attributes="office:value value;\n
table:style-name python: \'decimal_%s_%s\' % (style_prefix , field.get_value(\'precision\'))"\n
office:value-type="float"\n
table:style-name="decimal">\n
<text:p tal:content="python: field.render_pdf(value)" />\n
</table:table-cell>\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
<tal:block tal:condition="python:precision>0">\n
<table:table-cell tal:attributes="office:value value;\n
table:style-name python: \'decimal_%s_%s\' % (style_prefix , precision)"\n
office:value-type="float"\n
table:style-name="decimal">\n
<text:p tal:content="python: field.render_pdf(value)" />\n
</table:table-cell>\n
</tal:block>\n
<tal:block tal:condition="not: python: precision>0">\n
<table:table-cell tal:attributes="office:value value;\n
table:style-name string:${style_prefix}figure"\n
office:value-type="float"\n
table:style-name="figure">\n
<text:p tal:content="python: field.render_pdf(value)" />\n
</table:table-cell>\n
</tal:block> \n
</tal:block>\n
<tal:block tal:condition="not: python: field.get_value(\'precision\')>0">\n
<table:table-cell tal:attributes="office:value value;\n
table:style-name string:${style_prefix}figure"\n
office:value-type="float"\n
table:style-name="figure">\n
<text:p tal:content="python: field.render_pdf(value)" />\n
<tal:block tal:condition="python:field.meta_type not in [\'FloatField\',\'IntegerField\'] and field.meta_type!=\'ProxyField\'">\n
<table:table-cell tal:attributes="table:style-name string:${style_prefix}string;"\n
table:style-name="string"\n
office:value-type="string">\n
<text:p>Error: field is not a FloatField nor an IntegerField</text:p>\n
</table:table-cell>\n
</tal:block> \n
</tal:block>\n
<tal:block tal:condition="python:field.meta_type!=\'FloatField\' and field.meta_type!=\'ProxyField\'">\n
<table:table-cell tal:attributes="table:style-name string:${style_prefix}string;"\n
table:style-name="string"\n
office:value-type="string">\n
<text:p>Error: field is not a FloatField</text:p>\n
</table:table-cell>\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
<tal:block tal:condition="python: field is None">\n
......
176
\ No newline at end of file
190
\ No newline at end of file
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