Commit 81d05bb5 authored by Jérome Perrin's avatar Jérome Perrin

ooo_import: py3

parent cf511b48
......@@ -17,7 +17,7 @@ if active_process_path is None:
active_process_value = context.getPortalObject().restrictedTraverse(active_process_path)
result_list = [[x.method_id, x.result] for x in active_process_value.getResultList()]
result_list.sort()
result_list.sort(key=str)
for [method_id, result] in result_list:
safe_id = context.Base_getSafeIdFromString('result %s' % num)
......
......@@ -153,7 +153,9 @@ else:
if property_value:
# Create a new property value
property_id = column_mapping[line_property_index]
imported_line_property_dict[property_id] = property_value.encode('UTF-8')
if six.PY2:
property_value = property_value.encode('UTF-8')
imported_line_property_dict[property_id] = property_value
# If the line is not empty, activate an activity for it
......
......@@ -16,6 +16,7 @@
from ZODB.POSException import ConflictError
from Products.ERP5Type.Message import Message
import six
#Create new ERP5 objects In Activity from OOo document
imported_line = object_url = None
......@@ -46,7 +47,7 @@ else:
# Separate categories from properties
imported_line_category_dict = {}
for prop_key in imported_line_property_dict.keys():
for prop_key in list(six.iterkeys(imported_line_property_dict)):
if prop_key in base_category_list:
imported_line_category_dict[prop_key] = imported_line_property_dict.pop(prop_key)
......@@ -67,7 +68,7 @@ else:
success = 0
# Save the categories
for category, value in imported_line_category_dict.items():
for category, value in list(six.iteritems(imported_line_category_dict)):
category_dict = context.ERP5Site_getCategoriesFullPath(
category_dict={category: value})
if category_dict not in (None, {}):
......
This diff is collapsed.
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