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
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Rafael Monnerat
erp5
Commits
95df954b
Commit
95df954b
authored
Jan 22, 2025
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_tiosafe_core: Use ensuse_ascii (for py3)
parent
569f7809
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
bt5/erp5_tiosafe_core/DocumentTemplateItem/portal_components/document.erp5.IntegrationSite.py
...teItem/portal_components/document.erp5.IntegrationSite.py
+4
-3
No files found.
bt5/erp5_tiosafe_core/DocumentTemplateItem/portal_components/document.erp5.IntegrationSite.py
View file @
95df954b
...
...
@@ -29,6 +29,7 @@
from
Products.ERP5Type.Utils
import
ensure_ascii
from
Products.ERP5Type.Core.Folder
import
Folder
from
AccessControl
import
ClassSecurityInfo
from
Products.ERP5Type
import
Permissions
,
PropertySheet
...
...
@@ -101,7 +102,7 @@ class IntegrationSite(Folder):
for
cat
in
category
.
split
(
'/'
):
cat_id
=
cat
.
replace
(
' '
,
''
).
replace
(
'-'
,
''
)
try
:
cat_object
=
current_object
[
cat_id
.
encode
(
'ascii'
,
'ignore'
)]
cat_object
=
current_object
[
ensure_ascii
(
cat_id
,
errors
=
'ignore'
)]
except
KeyError
:
#LOG("getCategoryFromMapping", WARNING, "Nothing found for %s , %s on %s" %(category, cat_id, current_object.getPath()))
if
current_object
.
getPortalType
()
==
"Integration Base Category Mapping"
:
...
...
@@ -114,13 +115,13 @@ class IntegrationSite(Folder):
return
current_object
.
getDestinationReference
()
+
'/'
+
category
.
split
(
'/'
,
1
)[
1
]
else
:
# Create default line that has to be mapped by user later
cat_object
=
current_object
.
newContent
(
id
=
cat_id
.
encode
(
'ascii'
,
'ignore'
),
source_reference
=
cat
,
title
=
cat
)
cat_object
=
current_object
.
newContent
(
id
=
ensure_ascii
(
cat_id
,
errors
=
'ignore'
),
source_reference
=
cat
,
title
=
cat
)
LOG
(
"getCategoryFromMapping"
,
INFO
,
"created mapping %s - %s"
%
(
cat
,
cat_object
),)
missing_mapping
=
True
else
:
if
create_mapping
:
cat_object
=
current_object
.
newContent
(
portal_type
=
"Integration Base Category Mapping"
,
id
=
cat_id
.
encode
(
'ascii'
,
'ignore'
),
source_reference
=
cat
,
title
=
cat
)
id
=
ensure_ascii
(
cat_id
,
errors
=
'ignore'
),
source_reference
=
cat
,
title
=
cat
)
LOG
(
"getCategoryFromMapping"
,
INFO
,
"created base mapping %s - %s"
%
(
cat
,
cat_object
),)
missing_mapping
=
True
else
:
...
...
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