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
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
a1dcd5f5
Commit
a1dcd5f5
authored
Feb 11, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BusinessTemplate: py3
parent
26e49915
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
product/ERP5/Document/BusinessTemplate.py
product/ERP5/Document/BusinessTemplate.py
+7
-6
No files found.
product/ERP5/Document/BusinessTemplate.py
View file @
a1dcd5f5
...
@@ -351,7 +351,6 @@ class BusinessTemplateArchive(object):
...
@@ -351,7 +351,6 @@ class BusinessTemplateArchive(object):
if
hasattr
(
obj
,
'read'
):
if
hasattr
(
obj
,
'read'
):
obj
.
seek
(
0
)
obj
.
seek
(
0
)
obj
=
obj
.
read
()
obj
=
obj
.
read
()
#import pdb; pdb.set_trace()
if
not
isinstance
(
obj
,
bytes
):
if
not
isinstance
(
obj
,
bytes
):
obj
=
obj
.
encode
(
'utf-8'
)
obj
=
obj
.
encode
(
'utf-8'
)
self
.
revision
.
hash
(
path
,
obj
)
self
.
revision
.
hash
(
path
,
obj
)
...
@@ -875,7 +874,7 @@ class ObjectTemplateItem(BaseTemplateItem):
...
@@ -875,7 +874,7 @@ class ObjectTemplateItem(BaseTemplateItem):
f
=
StringIO
()
f
=
StringIO
()
exportXML
(
obj
.
_p_jar
,
obj
.
_p_oid
,
f
)
exportXML
(
obj
.
_p_jar
,
obj
.
_p_oid
,
f
)
bta
.
addObject
(
f
.
getvalue
().
encode
(
),
key
,
path
=
path
)
bta
.
addObject
(
str2bytes
(
f
.
getvalue
()
),
key
,
path
=
path
)
if
catalog_method_template_item
:
if
catalog_method_template_item
:
# add all datas specific to catalog inside one file
# add all datas specific to catalog inside one file
...
@@ -1532,7 +1531,7 @@ class ObjectTemplateItem(BaseTemplateItem):
...
@@ -1532,7 +1531,7 @@ class ObjectTemplateItem(BaseTemplateItem):
# in a separate file (such as the one from
# in a separate file (such as the one from
# testTemplateTool.TestTemplateTool.test_updateBusinessTemplateFromUrl_keep_list)
# testTemplateTool.TestTemplateTool.test_updateBusinessTemplateFromUrl_keep_list)
# data might be loaded as a string, fix this here.
# data might be loaded as a string, fix this here.
if
not
isinstance
(
obj
.
data
,
(
bytes
,
Pdata
)):
if
obj
.
data
is
not
None
and
not
isinstance
(
obj
.
data
,
(
bytes
,
Pdata
)):
obj
.
data
=
obj
.
data
.
encode
()
obj
.
data
=
obj
.
data
.
encode
()
# XXX Calling obj._setData() would call Interaction Workflow such
# XXX Calling obj._setData() would call Interaction Workflow such
# as document_conversion_interaction_workflow which would update
# as document_conversion_interaction_workflow which would update
...
@@ -6114,8 +6113,8 @@ Business Template is a set of definitions, such as skins, portal types and categ
...
@@ -6114,8 +6113,8 @@ Business Template is a set of definitions, such as skins, portal types and categ
'_test_item'
,
'_message_translation_item'
,]
'_test_item'
,
'_message_translation_item'
,]
if
item_name
in
item_list_1
:
if
item_name
in
item_list_1
:
f1
=
Bytes
IO
()
# for XML export of New Object
f1
=
String
IO
()
# for XML export of New Object
f2
=
Bytes
IO
()
# For XML export of Installed Object
f2
=
String
IO
()
# For XML export of Installed Object
# Remove unneeded properties
# Remove unneeded properties
new_object
=
new_item
.
removeProperties
(
new_object
,
1
)
new_object
=
new_item
.
removeProperties
(
new_object
,
1
)
installed_object
=
installed_item
.
removeProperties
(
installed_object
,
1
)
installed_object
=
installed_item
.
removeProperties
(
installed_object
,
1
)
...
@@ -6759,7 +6758,9 @@ Business Template is a set of definitions, such as skins, portal types and categ
...
@@ -6759,7 +6758,9 @@ Business Template is a set of definitions, such as skins, portal types and categ
from
base64
import
b64encode
from
base64
import
b64encode
def
__newTempComponent
(
portal_type
,
reference
,
source_reference
,
migrate
=
False
):
def
__newTempComponent
(
portal_type
,
reference
,
source_reference
,
migrate
=
False
):
uid
=
b64encode
(
"%s|%s|%s"
%
(
portal_type
,
reference
,
source_reference
))
uid
=
b64encode
((
"%s|%s|%s"
%
(
portal_type
,
reference
,
source_reference
)).
encode
())
if
six
.
PY3
:
uid
=
uid
.
decode
()
if
migrate
:
if
migrate
:
bt_migratable_uid_list
.
append
(
uid
)
bt_migratable_uid_list
.
append
(
uid
)
...
...
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