Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Carlos Ramos Carreño
erp5
Commits
4587e460
Commit
4587e460
authored
Feb 08, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ooo_import: py3
parent
be1fc51b
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
37 deletions
+45
-37
bt5/erp5_ooo_import/SkinTemplateItem/portal_skins/erp5_ooo_import/Base_getReportResultList.py
.../portal_skins/erp5_ooo_import/Base_getReportResultList.py
+1
-1
bt5/erp5_ooo_import/SkinTemplateItem/portal_skins/erp5_ooo_import/Base_importFile.py
...plateItem/portal_skins/erp5_ooo_import/Base_importFile.py
+3
-1
bt5/erp5_ooo_import/SkinTemplateItem/portal_skins/erp5_ooo_import/Base_importFileLineDefaultScript.py
...skins/erp5_ooo_import/Base_importFileLineDefaultScript.py
+3
-2
product/ERP5OOo/tests/testOOoImport.py
product/ERP5OOo/tests/testOOoImport.py
+38
-33
No files found.
bt5/erp5_ooo_import/SkinTemplateItem/portal_skins/erp5_ooo_import/Base_getReportResultList.py
View file @
4587e460
...
...
@@ -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
)
...
...
bt5/erp5_ooo_import/SkinTemplateItem/portal_skins/erp5_ooo_import/Base_importFile.py
View file @
4587e460
...
...
@@ -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
...
...
bt5/erp5_ooo_import/SkinTemplateItem/portal_skins/erp5_ooo_import/Base_importFileLineDefaultScript.py
View file @
4587e460
...
...
@@ -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
,
{}):
...
...
product/ERP5OOo/tests/testOOoImport.py
View file @
4587e460
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment