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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hugo Ricateau
erp5
Commits
8aa43f64
Commit
8aa43f64
authored
Jan 05, 2018
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Business Property Item: Update edit and aadd function for updating follow up list
parent
421b11a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
4 deletions
+40
-4
product/ERP5/Document/BusinessTemplateV2.py
product/ERP5/Document/BusinessTemplateV2.py
+40
-4
No files found.
product/ERP5/Document/BusinessTemplateV2.py
View file @
8aa43f64
...
...
@@ -1128,10 +1128,17 @@ class BusinessPropertyItem(XMLObject):
"""
Overriden function so that we can update attributes for BusinessItem objects
"""
return
super
(
BusinessPropertyItem
,
self
).
_edit
(
item_path
=
item_path
,
item_sign
=
item_sign
,
item_layer
=
item_layer
,
**
kw
)
super
(
BusinessPropertyItem
,
self
).
_edit
(
item_path
=
item_path
,
item_sign
=
item_sign
,
item_layer
=
item_layer
,
**
kw
)
# Build the object here, if the item_path has been added/updated
# XXX: We also need to add attribute to ensure that this doesn't happen
# while in tests or while creating them on the fly
if
'item_path'
in
self
.
_v_modified_property_dict
:
self
.
build
(
self
.
aq_parent
)
def
build
(
self
,
context
,
**
kw
):
p
=
context
.
getPortalObject
()
...
...
@@ -1144,6 +1151,35 @@ class BusinessPropertyItem(XMLObject):
self
.
setProperty
(
'item_property_type'
,
property_type
)
self
.
setProperty
(
'item_property_value'
,
property_value
)
def
updateFollowUpPathList
(
self
):
"""
Update the path list for Follow Up Business Template V2
"""
template
=
self
.
getFollowUpValue
()
# Check if the template has already been set or not
if
template
:
# Copy the path list for Business Template V2 and update it with new path
item_path_list
=
template
.
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 template with new path list
template
.
setItemPathList
(
item_path_list
)
else
:
# Complain loudly if the follow_up is not there
raise
ValueError
(
'Follow Up Business Template V2 is not set or defined yet'
)
def
install
(
self
,
context
,
*
args
):
# Get portal object
try
:
...
...
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