Commit 9920c962 authored by Thibaut Deheunynck's avatar Thibaut Deheunynck

2008-09-23 thibaut

* add new styles in ods render 
  When you use editable float field in listbox, you can enter a precison. If you enter a precision between 1 and 4, so you have between one and four decimal in your report. If precision is not enter or higher than four, so the report use default style for this filed ( ie : two decimals )

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23761 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 439e26da
...@@ -9,12 +9,6 @@ ...@@ -9,12 +9,6 @@
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>_bind_names</string> </key> <key> <string>_bind_names</string> </key>
<value> <value>
...@@ -99,17 +93,62 @@ ...@@ -99,17 +93,62 @@
</tal:block>\n </tal:block>\n
<tal:block tal:condition="python: value is not None and not is_list">\n <tal:block tal:condition="python: value is not None and not is_list">\n
<tal:block tal:condition="is_float">\n <tal:block tal:condition="is_float">\n
<table:table-cell tal:define="field python: editable_fields.get(column_id, None)"\n <tal:block tal:condition="python: isinstance(value, (int, long))">\n
tal:attributes="office:value value;\n <table:table-cell tal:define="field python: editable_fields.get(column_id, None)"\n
table:style-name string:${style_prefix}figure"\n tal:attributes="office:value value;\n
office:value-type="float"\n table:style-name string:${style_prefix}figure"\n
table:style-name="figure">\n office:value-type="float"\n
<text:p tal:condition="python: field is None"\n table:style-name="figure">\n
tal:content="python: value"/>\n <text:p tal:condition="python: field is None"\n
<text:p tal:condition="python: field is not None"\n tal:content="python: value"/>\n
tal:content="python: field.render_pdf(value)">\n <text:p tal:condition="python: field is not None"\n
</text:p>\n tal:content="python: field.render_pdf(value)">\n
</table:table-cell>\n </text:p>\n
</table:table-cell>\n
</tal:block>\n
<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:style_prefix+str(field.get_value(\'precision\'))+\'_decimal\'"\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="python: field.get_value(\'precision\') is None">\n
<table:table-cell tal:attributes="office:value value;\n
table:style-name string:${style_prefix}decimal"\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>\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 tal:condition="python: field is None">\n
<table:table-cell tal:attributes="office:value value;\n
table:style-name string:${style_prefix}decimal"\n
office:value-type="float"\n
table:style-name="decimal">\n
<text:p tal:condition="python: field is None"\n
tal:content="python: value"/>\n
<text:p tal:condition="python: field is not None"\n
tal:content="python: field.render_pdf(value)">\n
</text:p>\n
</table:table-cell>\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
</tal:block>\n </tal:block>\n
<tal:block tal:condition="not: is_float">\n <tal:block tal:condition="not: is_float">\n
<tal:block tal:condition="python: isinstance(value, DateTime)">\n <tal:block tal:condition="python: isinstance(value, DateTime)">\n
......
...@@ -9,12 +9,6 @@ ...@@ -9,12 +9,6 @@
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>_bind_names</string> </key> <key> <string>_bind_names</string> </key>
<value> <value>
...@@ -146,6 +140,30 @@ ...@@ -146,6 +140,30 @@
<style:style style:name="date_with_time" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="date_style">\n <style:style style:name="date_with_time" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="date_style">\n
<style:table-cell-properties style:vertical-align=\'middle\' style:repeat-content=\'false\' style:text-align-source=\'fix\' fo:border-right=\'0.002cm solid #000000\' />\n <style:table-cell-properties style:vertical-align=\'middle\' style:repeat-content=\'false\' style:text-align-source=\'fix\' fo:border-right=\'0.002cm solid #000000\' />\n
</style:style>\n </style:style>\n
<number:number-style style:name="four_decimal">\n
<number:number number:decimal-places="4" number:min-integer-digits="1" number:grouping="true"/>\n
</number:number-style>\n
<number:number-style style:name="three_decimal">\n
<number:number number:decimal-places="3" number:min-integer-digits="1" number:grouping="true"/>\n
</number:number-style>\n
<number:number-style style:name="two_decimal">\n
<number:number number:decimal-places="2" number:min-integer-digits="1" number:grouping="true"/>\n
</number:number-style>\n
<number:number-style style:name="one_decimal">\n
<number:number number:decimal-places="1" number:min-integer-digits="1" number:grouping="true"/>\n
</number:number-style>\n
<style:style style:name="4_decimal" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="four_decimal">\n
<style:table-cell-properties style:vertical-align=\'middle\' style:repeat-content=\'false\' style:text-align-source=\'fix\' fo:border-right=\'0.002cm solid #000000\' />\n
</style:style>\n
<style:style style:name="3_decimal" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="three_decimal">\n
<style:table-cell-properties style:vertical-align=\'middle\' style:repeat-content=\'false\' style:text-align-source=\'fix\' fo:border-right=\'0.002cm solid #000000\' />\n
</style:style>\n
<style:style style:name="2_decimal" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="two_decimal">\n
<style:table-cell-properties style:vertical-align=\'middle\' style:repeat-content=\'false\' style:text-align-source=\'fix\' fo:border-right=\'0.002cm solid #000000\' />\n
</style:style>\n
<style:style style:name="1_decimal" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="one_decimal">\n
<style:table-cell-properties style:vertical-align=\'middle\' style:repeat-content=\'false\' style:text-align-source=\'fix\' fo:border-right=\'0.002cm solid #000000\' />\n
</style:style>\n
</office:automatic-styles>\n </office:automatic-styles>\n
</tal:block>\n </tal:block>\n
......
153 154
\ No newline at end of file \ 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