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
Frederic Thoma
erp5
Commits
9773d8e1
Commit
9773d8e1
authored
Aug 04, 2017
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bt5_config: Update template_path_list after updating Business Item or Business Property Item
parent
a13970ed
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
2 deletions
+44
-2
product/ERP5/Document/BusinessManager.py
product/ERP5/Document/BusinessManager.py
+44
-2
No files found.
product/ERP5/Document/BusinessManager.py
View file @
9773d8e1
...
@@ -672,10 +672,31 @@ class BusinessItem(XMLObject):
...
@@ -672,10 +672,31 @@ class BusinessItem(XMLObject):
"""
"""
Overriden function so that we can update attributes for BusinessItem objects
Overriden function so that we can update attributes for BusinessItem objects
"""
"""
return
super
(
BusinessItem
,
self
).
_edit
(
item_path
=
item_path
,
edited
=
super
(
BusinessItem
,
self
).
_edit
(
item_path
=
item_path
,
item_sign
=
item_sign
,
item_sign
=
item_sign
,
item_layer
=
item_layer
,
item_layer
=
item_layer
,
**
kw
)
**
kw
)
# Get the parent Business Manager and update the template_path_list
new_path
=
self
.
constructTemplatePath
()
manager
=
self
.
aq_parent
if
manager
:
template_path_list
=
manager
.
getProperty
(
'template_path_list'
)
if
not
template_path_list
:
template_path_list
=
[]
new_template_path_list
=
list
(
template_path_list
)
new_template_path_list
.
append
(
new_path
)
manager
.
setProperty
(
'template_path_list'
,
new_template_path_list
)
return
edited
def
constructTemplatePath
(
self
):
"""
Create template_path in the format <path> | <sign> | <layer>
This path can be used to update template_path_list for the Business Manager
"""
item_path
=
self
.
getProperty
(
'item_path'
)
item_sign
=
self
.
getProperty
(
'item_sign'
)
item_layer
=
self
.
getProperty
(
'item_layer'
)
return
(
' | '
).
join
([
item_path
,
str
(
item_sign
),
str
(
item_layer
)])
def
build
(
self
,
context
,
**
kw
):
def
build
(
self
,
context
,
**
kw
):
"""
"""
...
@@ -1000,10 +1021,31 @@ class BusinessPropertyItem(XMLObject):
...
@@ -1000,10 +1021,31 @@ class BusinessPropertyItem(XMLObject):
"""
"""
Overriden function so that we can update attributes for BusinessItem objects
Overriden function so that we can update attributes for BusinessItem objects
"""
"""
return
super
(
BusinessPropertyItem
,
self
).
_edit
(
item_path
=
item_path
,
edited
=
super
(
BusinessPropertyItem
,
self
).
_edit
(
item_path
=
item_path
,
item_sign
=
item_sign
,
item_sign
=
item_sign
,
item_layer
=
item_layer
,
item_layer
=
item_layer
,
**
kw
)
**
kw
)
# Get the parent Business Manager and update the template_path_list
new_path
=
self
.
constructTemplatePath
()
manager
=
self
.
aq_parent
if
manager
:
template_path_list
=
manager
.
getProperty
(
'template_path_list'
)
if
not
template_path_list
:
template_path_list
=
[]
new_template_path_list
=
list
(
template_path_list
)
new_template_path_list
.
append
(
new_path
)
manager
.
setProperty
(
'template_path_list'
,
new_template_path_list
)
return
edited
def
constructTemplatePath
(
self
):
"""
Create template_path in the format <path> | <sign> | <layer>
This path can be used to update template_path_list for the Business Manager
"""
item_path
=
self
.
getProperty
(
'item_path'
)
item_sign
=
self
.
getProperty
(
'item_sign'
)
item_layer
=
self
.
getProperty
(
'item_layer'
)
return
(
' | '
).
join
([
item_path
,
str
(
item_sign
),
str
(
item_layer
)])
def
build
(
self
,
context
,
**
kw
):
def
build
(
self
,
context
,
**
kw
):
p
=
context
.
getPortalObject
()
p
=
context
.
getPortalObject
()
...
...
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