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
140
Merge Requests
140
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
a5b8e03b
Commit
a5b8e03b
authored
Mar 13, 2023
by
Kazuhiko Shiozaki
Committed by
Jérome Perrin
Dec 27, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "WIP: py2/py3: store file content as it is in Business Template for PathTemplateItem."
This reverts commit
45ce6a21
.
parent
ef88fa18
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
7 deletions
+1
-7
product/ERP5/Document/BusinessTemplate.py
product/ERP5/Document/BusinessTemplate.py
+1
-7
No files found.
product/ERP5/Document/BusinessTemplate.py
View file @
a5b8e03b
...
@@ -940,7 +940,7 @@ class ObjectTemplateItem(BaseTemplateItem):
...
@@ -940,7 +940,7 @@ class ObjectTemplateItem(BaseTemplateItem):
# ObjectTemplateItem.__init__()
# ObjectTemplateItem.__init__()
# XXX - the above comment is a bit unclear,
# XXX - the above comment is a bit unclear,
# still not sure if this is handled correctly
# still not sure if this is handled correctly
if
obj_key
.
split
(
os
.
path
.
sep
,
1
)[
0
]
==
'portal_components'
:
if
file_obj
.
name
.
rsplit
(
os
.
path
.
sep
,
2
)[
-
2
]
==
'portal_components'
:
self
.
_archive
[
obj_key
]
=
None
self
.
_archive
[
obj_key
]
=
None
try
:
try
:
del
self
.
_archive
[
obj_key
[
len
(
'portal_components/'
):]]
del
self
.
_archive
[
obj_key
[
len
(
'portal_components/'
):]]
...
@@ -1678,7 +1678,6 @@ class PathTemplateItem(ObjectTemplateItem):
...
@@ -1678,7 +1678,6 @@ class PathTemplateItem(ObjectTemplateItem):
id_list
=
ensure_list
(
self
.
_archive
.
keys
())
id_list
=
ensure_list
(
self
.
_archive
.
keys
())
self
.
_archive
.
clear
()
self
.
_archive
.
clear
()
self
.
_path_archive
=
PersistentMapping
()
self
.
_path_archive
=
PersistentMapping
()
self
.
_files
=
PersistentMapping
()
for
id
in
id_list
:
for
id
in
id_list
:
self
.
_path_archive
[
id
]
=
None
self
.
_path_archive
[
id
]
=
None
...
@@ -1770,8 +1769,6 @@ class PathTemplateItem(ObjectTemplateItem):
...
@@ -1770,8 +1769,6 @@ class PathTemplateItem(ObjectTemplateItem):
obj
.
wl_clearLocks
()
obj
.
wl_clearLocks
()
def
install
(
self
,
context
,
*
args
,
**
kw
):
def
install
(
self
,
context
,
*
args
,
**
kw
):
for
file_name
,
data
in
six
.
iteritems
(
self
.
_files
):
super
(
PathTemplateItem
,
self
).
_importFile
(
file_name
,
BytesIO
(
data
))
super
(
PathTemplateItem
,
self
).
install
(
context
,
*
args
,
**
kw
)
super
(
PathTemplateItem
,
self
).
install
(
context
,
*
args
,
**
kw
)
# Regenerate local roles for all paths in this business template
# Regenerate local roles for all paths in this business template
...
@@ -1811,9 +1808,6 @@ class PathTemplateItem(ObjectTemplateItem):
...
@@ -1811,9 +1808,6 @@ class PathTemplateItem(ObjectTemplateItem):
%
(
portal_type
,
obj
.
getRelativeUrl
()))
%
(
portal_type
,
obj
.
getRelativeUrl
()))
transaction
.
get
().
addBeforeCommitHook
(
updateLocalRolesOnDocument
)
transaction
.
get
().
addBeforeCommitHook
(
updateLocalRolesOnDocument
)
def
_importFile
(
self
,
file_name
,
file_obj
):
self
.
_files
[
file_name
]
=
file_obj
.
read
()
class
ToolTemplateItem
(
PathTemplateItem
):
class
ToolTemplateItem
(
PathTemplateItem
):
"""This class is used only for making a distinction between other objects
"""This class is used only for making a distinction between other objects
and tools, because tools may not be backed up.
and tools, because tools may not be backed up.
...
...
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