diff --git a/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/form_view.xml b/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/form_view.xml index 9c47bb656c127e7473f4bdd2b8b577f508158c8c..571b0e622e0e7c8544980905f88afa507d390bb1 100644 --- a/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/form_view.xml +++ b/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/form_view.xml @@ -55,19 +55,6 @@ dQEAAAAA</string> </value> <tal:block metal:use-macro="here/style_macros/macros/style_macro"/>\n <office:body>\n <office:spreadsheet>\n - <!-- calculate max column len -->\n - <tal:block tal:define="field_list python:form.get_fields_in_group(\'bottom\')">\n - <tal:block tal:define="global column_len python:3"/>\n - <tal:block tal:condition=\'field_list\'>\n - <tal:block tal:define="field python:field_list[0]">\n - <tal:block tal:condition="python:field.meta_type == \'ListBox\' or (field.meta_type == \'ProxyField\' and field.getRecursiveTemplateField().meta_type == \'ListBox\')">\n - <tal:block tal:define="column_list python: field.get_value(\'columns\');\n - global column_len python: len(column_list)" />\n - </tal:block>\n - </tal:block>\n - </tal:block>\n - </tal:block>\n -\n <table:table table:style-name=\'ta1\' table:print=\'false\' tal:attributes="table:name python: unicode(here.getTitle(), \'utf-8\')" i18n:attributes="table:name">\n <!-- at least one table-column element is required for ODF to validate -->\n <table:table-column\n @@ -75,6 +62,29 @@ dQEAAAAA</string> </value> table:default-cell-style-name=\'report-column-title\'/>\n \n <tal:block metal:define-macro="form_layout">\n +\n + <!-- if we have other fields to display, calculate max column len, which will be used later to make standard fields (ie. not listbox) using covered cells -->\n + <tal:block tal:condition="python: len(form.get_fields()) > 1">\n + <tal:block tal:condition="report_item | nothing">\n + <tal:block tal:define="global column_len python: report_item.selection_columns and len(report_item.selection_columns) or 0;"/>\n + </tal:block>\n + <tal:block>\n + <tal:block tal:condition="not: column_len | nothing"\n + tal:define="field_list python:form.get_fields_in_group(\'bottom\')"> \n + <tal:block tal:define="global column_len python: 5"/>\n + <!-- This default is used for the ERP5 Report itself, which often does not contain a listbox directly -->\n + <tal:block tal:condition=\'field_list\'>\n + <tal:block tal:define="field python:field_list[0]">\n + <tal:block tal:condition="python:field.meta_type == \'ListBox\' or (field.meta_type == \'ProxyField\' and field.getRecursiveTemplateField().meta_type == \'ListBox\')">\n + <tal:block tal:define="column_list python: field.get_value(\'columns\');\n + global column_len python: len(column_list)" />\n + </tal:block>\n + </tal:block>\n + </tal:block>\n + </tal:block>\n + </tal:block>\n + </tal:block>\n +\n <tal:block tal:define="dummy python: request.set(\'here\', here)">\n <tal:block tal:repeat="group python: [g for g in form.get_groups() if g not in (\'bottom\', \'hidden\')]">\n <tal:block tal:define="field_list python: form.get_fields_in_group(group)">\n @@ -147,7 +157,7 @@ dQEAAAAA</string> </value> </tal:block>\n </tal:block>\n \n - <tal:block tal:repeat="group python: [g for g in form.get_groups() if g not in ( \'hidden\')]">\n + <tal:block tal:repeat="group python: [g for g in form.get_groups() if g not in (\'hidden\', )]">\n <tal:block tal:define="field_list python: form.get_fields_in_group(group)">\n <tal:block tal:condition="python: field_list not in [None, []]">\n \n diff --git a/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/report_view.xml b/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/report_view.xml index 353f7b1305e24d6eefda1860c6c1be3c54b47cdd..bece2a64e9c0e6b4c66b7570ff0a9da6cde89a18 100644 --- a/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/report_view.xml +++ b/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/report_view.xml @@ -53,9 +53,7 @@ <tal:block tal:define="rendered_report_item_list rendered_report_item_list | python:[];\n report_item_list python: rendered_report_item_list or [];\n dummy python: request.set(\'here\', here);\n - global sheet_per_reportsection python: int(request.get(\'sheet_per_report_section\', 0));\n - global column_len python: 5">\n - <!-- TODO: calculate column_len based on the first listbox (or selection_column if exists)-->\n + global sheet_per_reportsection python: int(request.get(\'sheet_per_report_section\', 0));">\n <tal:block tal:condition="not: report_item_list">\n <tal:block tal:condition="python: form.meta_type == \'ERP5 Report\'">\n <tal:block tal:define="dummy python: report_item_list.extend(report_method())" />\n diff --git a/bt5/erp5_ods_style/bt/revision b/bt5/erp5_ods_style/bt/revision index cc4f7f3feba9cb8765296f4ce390a79adf482e95..1199cd493e5b0f7c20b1040406896a3f2004c700 100644 --- a/bt5/erp5_ods_style/bt/revision +++ b/bt5/erp5_ods_style/bt/revision @@ -1 +1 @@ -218 \ No newline at end of file +219 \ No newline at end of file