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
Aug 22, 2017
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):
...
@@ -624,38 +624,27 @@ class BusinessItem(XMLObject):
p
=
context
.
getPortalObject
()
p
=
context
.
getPortalObject
()
path
=
self
.
getProperty
(
'item_path'
)
path
=
self
.
getProperty
(
'item_path'
)
try
:
obj
=
p
.
unrestrictedTraverse
(
path
)
# XXX: After we apply _resolve path list while storing Data for the
obj
=
obj
.
_getCopy
(
context
)
# 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
# We should remove the extra properties of object so that there
# from the result of _resolvePath on a given path.
# shouldn't be redundancy of the proeprties
# TODO: Remove this after checking successfull implementation of
removable_property_list
=
kw
.
get
(
'removable_property_list'
)
# _resolve path in Business Manager in storeTemplateData
for
relative_url
in
self
.
_resolvePath
(
p
,
[],
path
.
split
(
'/'
)):
# We should also add extra parameter to remove sub-objects by removing
obj
=
p
.
unrestrictedTraverse
(
relative_url
)
# `_tree` for any erp5 object. This way we can have control over adding
obj
=
obj
.
_getCopy
(
context
)
# sub-objects as new Business Item objects
remove_sub_objects
=
kw
.
get
(
'remove_sub_objects'
)
# We should remove the extra properties of object so that there
if
remove_sub_objects
:
# shouldn't be redundancy of the proeprties
removable_property_list
.
append
(
'_tree'
)
removable_property_list
=
kw
.
get
(
'removable_property_list'
)
obj
=
self
.
removeProperties
(
obj
,
1
,
properties
=
removable_property_list
)
obj
=
obj
.
__of__
(
context
)
# We should also add extra parameter to remove sub-objects by removing
# XXX: '_recursiveRemoveUid' is not working as expected
# `_tree` for any erp5 object. This way we can have control over adding
_recursiveRemoveUid
(
obj
)
# sub-objects as new Business Item objects
obj
=
aq_base
(
obj
)
remove_sub_objects
=
kw
.
get
(
'remove_sub_objects'
)
obj
.
isIndexable
=
ConstantGetter
(
'isIndexable'
,
value
=
False
)
if
remove_sub_objects
:
new_id
=
self
.
generateNewId
()
removable_property_list
.
append
(
'_tree'
)
self
.
_setObject
(
new_id
,
obj
,
suppress_events
=
True
)
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
def
_resolvePath
(
self
,
folder
,
relative_url_list
,
id_list
):
def
_resolvePath
(
self
,
folder
,
relative_url_list
,
id_list
):
"""
"""
...
...
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