Commit fe7a66eb authored by Jérome Perrin's avatar Jérome Perrin

simple fixes from python3 port

See merge request !1941
parents 0b8b8475 79d55baf
...@@ -65,6 +65,10 @@ def transformUrlToDataURI(content): ...@@ -65,6 +65,10 @@ def transformUrlToDataURI(content):
if url_value.startswith("http"): if url_value.startswith("http"):
image.set(xlink_href, getDataURI(image.get(xlink_href))) image.set(xlink_href, getDataURI(image.get(xlink_href)))
return """<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n""" + \ return etree.tostring(
etree.tostring(root) root,
encoding="utf-8",
xml_declaration=True,
standalone="no",
)
...@@ -12,7 +12,6 @@ There are runtime values hidden in every dialog form (injected by getHateoas Scr ...@@ -12,7 +12,6 @@ There are runtime values hidden in every dialog form (injected by getHateoas Scr
extra_param_json - JSON serialized extra parameters for the dialog script extra_param_json - JSON serialized extra parameters for the dialog script
""" """
from erp5.component.module.Log import log, WARNING
from Products.Formulator.Errors import FormValidationError from Products.Formulator.Errors import FormValidationError
import json import json
import six import six
...@@ -137,7 +136,7 @@ try: ...@@ -137,7 +136,7 @@ try:
return context.Base_renderForm(dialog_id, return context.Base_renderForm(dialog_id,
message=translate('Only ODT, ODS, Hal and HalRestricted skins are allowed for reports '\ message=translate('Only ODT, ODS, Hal and HalRestricted skins are allowed for reports '\
'in Preferences - User Interface - Report Style'), 'in Preferences - User Interface - Report Style'),
level=WARNING, level='warning',
form_data=form_data) form_data=form_data)
except FormValidationError as validation_errors: except FormValidationError as validation_errors:
...@@ -180,10 +179,6 @@ for field in form.get_fields(): ...@@ -180,10 +179,6 @@ for field in form.get_fields():
if len(listbox_id_list): if len(listbox_id_list):
# Warn if there are more than one listbox in form ...
if len(listbox_id_list) > 1:
log('Base_callDialogMethod', 'There are %s listboxes in form %s.' % (len(listbox_id_list), form.id))
# ... but handle them anyway.
for listbox_id in listbox_id_list: for listbox_id in listbox_id_list:
listbox_line_list = [] listbox_line_list = []
listbox = kw[listbox_id] listbox = kw[listbox_id]
......
...@@ -147,7 +147,7 @@ ...@@ -147,7 +147,7 @@
</tal:block> </tal:block>
<tal:block tal:condition="python: field is not None"> <tal:block tal:condition="python: field is not None">
<tal:block tal:condition="python:field.meta_type=='DateTimeField' or (field.meta_type == 'ProxyField' and field.getRecursiveTemplateField().meta_type == 'DateTimeField')"> <tal:block tal:condition="python:field.meta_type=='DateTimeField' or (field.meta_type == 'ProxyField' and field.getRecursiveTemplateField().meta_type == 'DateTimeField')">
<tal:block tal:condition="python:field.get_value('date_only')" tal:define="input_order python:field.get_value('input_order')"> <tal:block tal:condition="python:field.get_value('date_only')" tal:define="input_order python:field.get_value('input_order') or 'ymd'">
<table:table-cell tal:attributes="office:date-value python: context.ERP5Site_formatDateForODF(value); <table:table-cell tal:attributes="office:date-value python: context.ERP5Site_formatDateForODF(value);
table:style-name string:${style_prefix}date_${input_order};" table:style-name string:${style_prefix}date_${input_order};"
table:style-name="date" table:style-name="date"
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
<text:p tal:content="python: field.render_pdf(value)"/> <text:p tal:content="python: field.render_pdf(value)"/>
</table:table-cell> </table:table-cell>
</tal:block> </tal:block>
<tal:block tal:condition="python:not field.get_value('date_only')" tal:define="input_order python:field.get_value('input_order')"> <tal:block tal:condition="python:not field.get_value('date_only')" tal:define="input_order python:field.get_value('input_order') or 'ymd'">
<table:table-cell tal:attributes="office:date-value python: context.ERP5Site_formatDateForODF(value); <table:table-cell tal:attributes="office:date-value python: context.ERP5Site_formatDateForODF(value);
table:style-name string:${style_prefix}date_with_time_${input_order};" table:style-name string:${style_prefix}date_with_time_${input_order};"
table:style-name="date_with_time" table:style-name="date_with_time"
......
...@@ -4,5 +4,5 @@ td = context.newContent( ...@@ -4,5 +4,5 @@ td = context.newContent(
portal_type='OOo Document', portal_type='OOo Document',
temp_object=True, temp_object=True,
base_content_type=base_content_type, base_content_type=base_content_type,
base_data='not empty') base_data=b'not empty')
return [('', '')] + td.getTargetFormatItemList() return [('', '')] + sorted(td.getTargetFormatItemList())
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