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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
erp5
Commits
d23a57af
Commit
d23a57af
authored
11 years ago
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix 'Upload Business Template' that did not work when the first entry was not the root directory.
parent
b6ad0793
master
bk_erp5ish_actions_tool
bk_officejs
bk_officejs.170922
bk_officejs.backup_new_bt
bk_officejs.backup_new_bt_second
bk_officejs_AttachmentSyncOff
bk_officejs_setVolatileSetting
bk_onlyoffice.170926
bk_onlyoffice.170926.test
bk_onlyoffice.170926.test.notpassed
bk_onlyoffice_fix_tests.171017
bk_onlyoffice_fix_tests.171017.test
bk_onlyoffice_in_skins.171120
bk_sqlcatalog
bootstrap_design
erp5_only_office
onlyoffice_gui_for_xmla
onlyoffice_tests_fix
raskon
schema_editor
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
product/ERP5/Tool/TemplateTool.py
product/ERP5/Tool/TemplateTool.py
+2
-1
No files found.
product/ERP5/Tool/TemplateTool.py
View file @
d23a57af
...
...
@@ -316,6 +316,7 @@ class TemplateTool (BaseTool):
# XXX: should really check for a magic and offer a falback if it
# doens't correspond to anything handled.
tar
=
tarfile
.
open
(
path
,
'r:gz'
)
dir_name
=
tar
.
members
[
0
].
name
.
split
(
posixpath
.
sep
,
1
)[
0
]
try
:
# create bt object
bt
=
self
.
newContent
(
portal_type
=
'Business Template'
,
id
=
id
)
...
...
@@ -323,7 +324,7 @@ class TemplateTool (BaseTool):
for
prop
in
bt
.
propertyMap
():
prop_type
=
prop
[
'type'
]
pid
=
prop
[
'id'
]
prop_path
=
posixpath
.
join
(
tar
.
members
[
0
].
name
,
'bt'
,
pid
)
prop_path
=
posixpath
.
join
(
dir_
name
,
'bt'
,
pid
)
try
:
info
=
tar
.
getmember
(
prop_path
)
value
=
tar
.
extractfile
(
info
).
read
()
...
...
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