[Erp5-report] r23761 - in /erp5/trunk/bt5/erp5_ods_style: SkinTemplateItem/portal_skins/erp...

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Sep 23 14:55:24 CEST 2008


Author: thibaut
Date: Tue Sep 23 14:55:12 2008
New Revision: 23761

URL: http://svn.erp5.org?rev=23761&view=rev
Log:
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 )

Modified:
    erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/field_ods_macro.xml
    erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/style_macros.xml
    erp5/trunk/bt5/erp5_ods_style/bt/revision

Modified: erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/field_ods_macro.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/field_ods_macro.xml?rev=23761&r1=23760&r2=23761&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/field_ods_macro.xml (original)
+++ erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/field_ods_macro.xml Tue Sep 23 14:55:12 2008
@@ -9,12 +9,6 @@
     </pickle>
     <pickle>
       <dictionary>
-        <item>
-            <key> <string>__ac_local_roles__</string> </key>
-            <value>
-              <none/>
-            </value>
-        </item>
         <item>
             <key> <string>_bind_names</string> </key>
             <value>
@@ -99,17 +93,62 @@
         </tal:block>\n
         <tal:block tal:condition="python: value is not None and not is_list">\n
           <tal:block tal:condition="is_float">\n
-           <table:table-cell tal:define="field python: editable_fields.get(column_id, None)"\n
-                             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: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 tal:condition="python: isinstance(value, (int, long))">\n
+              <table:table-cell tal:define="field python: editable_fields.get(column_id, None)"\n
+                                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: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 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 tal:condition="not: is_float">\n
             <tal:block tal:condition="python: isinstance(value, DateTime)">\n

Modified: erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/style_macros.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/style_macros.xml?rev=23761&r1=23760&r2=23761&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/style_macros.xml (original)
+++ erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/style_macros.xml Tue Sep 23 14:55:12 2008
@@ -9,12 +9,6 @@
     </pickle>
     <pickle>
       <dictionary>
-        <item>
-            <key> <string>__ac_local_roles__</string> </key>
-            <value>
-              <none/>
-            </value>
-        </item>
         <item>
             <key> <string>_bind_names</string> </key>
             <value>
@@ -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: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
+    <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
 </tal:block>\n
 

Modified: erp5/trunk/bt5/erp5_ods_style/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_ods_style/bt/revision?rev=23761&r1=23760&r2=23761&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_ods_style/bt/revision (original)
+++ erp5/trunk/bt5/erp5_ods_style/bt/revision Tue Sep 23 14:55:12 2008
@@ -1,1 +1,1 @@
-153
+154




More information about the Erp5-report mailing list