Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5_rtl_support
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Romain Courteaud
erp5_rtl_support
Commits
84cb2463
Commit
84cb2463
authored
Apr 10, 2017
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bt5_config: Only resolve path when build process is going on
parent
94f8b38e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
8 deletions
+22
-8
product/ERP5/Document/BusinessManager.py
product/ERP5/Document/BusinessManager.py
+22
-8
No files found.
product/ERP5/Document/BusinessManager.py
View file @
84cb2463
...
@@ -350,7 +350,7 @@ class BusinessManager(XMLObject):
...
@@ -350,7 +350,7 @@ class BusinessManager(XMLObject):
__rsub__
=
__sub__
__rsub__
=
__sub__
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'storeTemplateData'
)
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'storeTemplateData'
)
def
storeTemplateData
(
self
):
def
storeTemplateData
(
self
,
isBuild
=
False
):
"""
"""
Store data for objects in the ERP5
Store data for objects in the ERP5
"""
"""
...
@@ -362,6 +362,8 @@ class BusinessManager(XMLObject):
...
@@ -362,6 +362,8 @@ class BusinessManager(XMLObject):
if
path_item_list
:
if
path_item_list
:
path_item_list
=
[
l
.
split
(
' | '
)
for
l
in
path_item_list
]
path_item_list
=
[
l
.
split
(
' | '
)
for
l
in
path_item_list
]
new_path_item_list
=
[]
for
path_item
in
path_item_list
:
for
path_item
in
path_item_list
:
if
'#'
in
str
(
path_item
[
0
]):
if
'#'
in
str
(
path_item
[
0
]):
...
@@ -373,12 +375,24 @@ class BusinessManager(XMLObject):
...
@@ -373,12 +375,24 @@ class BusinessManager(XMLObject):
# same layer and sign
# same layer and sign
# XXX: Not very effective as it tries to get all the objects which makes
# XXX: Not very effective as it tries to get all the objects which makes
# it vey slow
# it vey slow
if
isBuild
:
# If build process, then resolve path and then update the path list
# and path item list for the BusinessItem
path_list
=
self
.
_resolvePath
(
portal
,
[],
path_item
[
0
].
split
(
'/'
))
path_list
=
self
.
_resolvePath
(
portal
,
[],
path_item
[
0
].
split
(
'/'
))
for
path
in
path_list
:
for
path
in
path_list
:
try
:
try
:
self
.
_path_item_list
.
append
(
BusinessItem
(
path
,
path_item
[
1
],
path_item
[
2
]))
self
.
_path_item_list
.
append
(
BusinessItem
(
path
,
path_item
[
1
],
path_item
[
2
]))
resolved_path
=
(
' | '
).
join
((
path
,
path_item
[
1
],
path_item
[
2
]))
new_path_item_list
.
append
(
resolved_path
)
except
IndexError
:
except
IndexError
:
pass
pass
else
:
# If not build, i.e, import/export, just update the _path_item_list
self
.
_path_item_list
.
append
(
BusinessItem
(
path_item
[
0
],
path_item
[
1
],
path_item
[
2
]))
if
isBuild
:
# If build process, update the path list of the Business Manager
self
.
_setTemplatePathList
(
new_path_item_list
)
def
_resolvePath
(
self
,
folder
,
relative_url_list
,
id_list
):
def
_resolvePath
(
self
,
folder
,
relative_url_list
,
id_list
):
"""
"""
...
@@ -443,7 +457,7 @@ class BusinessManager(XMLObject):
...
@@ -443,7 +457,7 @@ class BusinessManager(XMLObject):
OFS Database"""
OFS Database"""
LOG
(
'Business Manager'
,
INFO
,
'Building Business Manager'
)
LOG
(
'Business Manager'
,
INFO
,
'Building Business Manager'
)
if
not
no_action
:
if
not
no_action
:
self
.
storeTemplateData
()
self
.
storeTemplateData
(
isBuild
=
True
)
for
path_item
in
self
.
_path_item_list
:
for
path_item
in
self
.
_path_item_list
:
path_item
.
build
(
self
,
**
kw
)
path_item
.
build
(
self
,
**
kw
)
self
.
status
=
'built'
self
.
status
=
'built'
...
...
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