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
fb589044
Commit
fb589044
authored
Dec 06, 2017
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bt5_config: Update Business Manager path_list whenever we edit Business Item via Business Commit
parent
3f1786d3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
1 deletion
+32
-1
product/ERP5/Document/BusinessManager.py
product/ERP5/Document/BusinessManager.py
+32
-1
No files found.
product/ERP5/Document/BusinessManager.py
View file @
fb589044
...
...
@@ -196,7 +196,7 @@ class BusinessManager(Folder):
,
'filter_content_types'
:
1
}
item_path_list
=
[]
# Declarative security
security
=
ClassSecurityInfo
()
security
.
declareObjectProtected
(
Permissions
.
AccessContentsInformation
)
...
...
@@ -210,6 +210,15 @@ class BusinessManager(Folder):
PropertySheet
.
Version
,
)
# XXX: This explicit setter and getter should be replaced using property
# sheet.
def
setItemPathList
(
self
,
value
):
self
.
item_path_list
=
value
def
getItemPathList
(
self
):
return
self
.
item_path_list
def
getShortRevision
(
self
):
return
None
...
...
@@ -725,6 +734,28 @@ class BusinessItem(XMLObject):
if
'item_path'
in
self
.
_v_modified_property_dict
:
self
.
build
(
self
.
aq_parent
)
# Update the Business Manager with the path list everytime after editing
# item_path
manager
=
self
.
getFollowUpValue
()
# Copy the path list for Business Manager and update it with new path
item_path_list
=
manager
.
getItemPathList
()[:]
old_item_path
=
self
.
_v_modified_property_dict
.
get
(
'item_path'
)
if
old_item_path
and
item_path_list
:
if
old_item_path
in
item_path_list
:
for
idx
,
item
in
enumerate
(
item_path_list
):
if
item
==
old_item_path
:
item_path_list
[
idx
]
=
self
.
getProperty
(
'item_path'
)
else
:
item_path_list
.
append
(
self
.
getProperty
(
'item_path'
))
else
:
# If there is no old_item_path or if path_list is empty, we can just
# append the new_path in path_list
item_path_list
.
append
(
self
.
getProperty
(
'item_path'
))
# Update the manager with new path list
manager
.
setProperty
(
'item_path_list'
,
item_path_list
)
def
build
(
self
,
context
,
**
kw
):
"""
Extract value for the given path from the OFS
...
...
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