Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ayush Tiwari
erp5
Commits
e0725ff1
Commit
e0725ff1
authored
7 years ago
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bt5_config: Raise error in case object is not found. Also, no need to resolve path again
parent
8d9048b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
32 deletions
+21
-32
product/ERP5/Document/BusinessManager.py
product/ERP5/Document/BusinessManager.py
+21
-32
No files found.
product/ERP5/Document/BusinessManager.py
View file @
e0725ff1
...
...
@@ -624,38 +624,27 @@ class BusinessItem(XMLObject):
p
=
context
.
getPortalObject
()
path
=
self
.
getProperty
(
'item_path'
)
try
:
# XXX: After we apply _resolve path list while storing Data for the
# Business Manager, this should be of no use as there will be no path
# where we are going to achieve something different for relative_path
# from the result of _resolvePath on a given path.
# TODO: Remove this after checking successfull implementation of
# _resolve path in Business Manager in storeTemplateData
for
relative_url
in
self
.
_resolvePath
(
p
,
[],
path
.
split
(
'/'
)):
obj
=
p
.
unrestrictedTraverse
(
relative_url
)
obj
=
obj
.
_getCopy
(
context
)
# We should remove the extra properties of object so that there
# shouldn't be redundancy of the proeprties
removable_property_list
=
kw
.
get
(
'removable_property_list'
)
# We should also add extra parameter to remove sub-objects by removing
# `_tree` for any erp5 object. This way we can have control over adding
# sub-objects as new Business Item objects
remove_sub_objects
=
kw
.
get
(
'remove_sub_objects'
)
if
remove_sub_objects
:
removable_property_list
.
append
(
'_tree'
)
obj
=
self
.
removeProperties
(
obj
,
1
,
properties
=
removable_property_list
)
obj
=
obj
.
__of__
(
context
)
# XXX: '_recursiveRemoveUid' is not working as expected
_recursiveRemoveUid
(
obj
)
obj
=
aq_base
(
obj
)
obj
.
isIndexable
=
ConstantGetter
(
'isIndexable'
,
value
=
False
)
new_id
=
self
.
generateNewId
()
self
.
_setObject
(
new_id
,
obj
,
suppress_events
=
True
)
except
AttributeError
:
# In case the object doesn't exist, just pass without raising error
pass
obj
=
p
.
unrestrictedTraverse
(
path
)
obj
=
obj
.
_getCopy
(
context
)
# We should remove the extra properties of object so that there
# shouldn't be redundancy of the proeprties
removable_property_list
=
kw
.
get
(
'removable_property_list'
)
# We should also add extra parameter to remove sub-objects by removing
# `_tree` for any erp5 object. This way we can have control over adding
# sub-objects as new Business Item objects
remove_sub_objects
=
kw
.
get
(
'remove_sub_objects'
)
if
remove_sub_objects
:
removable_property_list
.
append
(
'_tree'
)
obj
=
self
.
removeProperties
(
obj
,
1
,
properties
=
removable_property_list
)
obj
=
obj
.
__of__
(
context
)
# XXX: '_recursiveRemoveUid' is not working as expected
_recursiveRemoveUid
(
obj
)
obj
=
aq_base
(
obj
)
obj
.
isIndexable
=
ConstantGetter
(
'isIndexable'
,
value
=
False
)
new_id
=
self
.
generateNewId
()
self
.
_setObject
(
new_id
,
obj
,
suppress_events
=
True
)
def
_resolvePath
(
self
,
folder
,
relative_url_list
,
id_list
):
"""
...
...
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