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
4179dd89
Commit
4179dd89
authored
Sep 20, 2017
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bt5_config: Update BusinessPatchItem class and its functions
parent
926204d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
9 deletions
+34
-9
product/ERP5/Document/BusinessManager.py
product/ERP5/Document/BusinessManager.py
+34
-9
No files found.
product/ERP5/Document/BusinessManager.py
View file @
4179dd89
...
...
@@ -155,6 +155,12 @@ def manage_addBusinessPropertyItem(self, item_path='', item_sign=1, item_layer=0
return
c
# New BusinessPatchItem addition function
def
manage_addBusinessPatchItem
(
self
,
item_path
=
''
,
item_sign
=
1
,
item_layer
=
0
,
*
args
,
**
kw
):
# Create BusinessPatchItem object container
c
=
BusinessPatchItem
(
item_path
,
item_sign
,
item_layer
)
return
c
class
BusinessManager
(
Folder
):
...
...
@@ -164,7 +170,9 @@ class BusinessManager(Folder):
meta_type
=
'ERP5 Business Manager'
portal_type
=
'Business Manager'
add_permission
=
Permissions
.
AddPortalContent
allowed_types
=
(
'Business Item'
,
'Business Property Item'
,)
allowed_types
=
(
'Business Item'
,
'Business Property Item'
,
'Business Patch item'
,)
# Declarative security
security
=
ClassSecurityInfo
()
...
...
@@ -1109,7 +1117,8 @@ class BusinessPropertyItem(XMLObject):
def
getBusinessItemPropertyValue
(
self
):
return
self
.
getProperty
(
'item_property_value'
)
class
BusinesTemplatePatchItem
(
XMLObject
):
class
BusinesPatchItem
(
XMLObject
):
"""
Business Item for saving patch and diff. This will help us to create a diff or
patch between the old value and current value.
...
...
@@ -1120,8 +1129,14 @@ class BusinesTemplatePatchItem(XMLObject):
item_layer -- layer
old -- old value
new -- new value
dependency_list -- a list of bt5 identifiers useful to rebuild the BusinesTemplatePatchItem instance
preserved_list -- a list of bt5 identifiers useful to rebuild the BusinesTemplatePatchItem instance
dependency_list -- a list of bt5 identifiers useful to rebuild the
BusinesTemplatePatchItem instance
preserved_list -- a list of bt5 identifiers useful to rebuild the
BusinesTemplatePatchItem instance
(XXX: We don't use `preserved_list` for now)
Business Patch Item can be both PathItem or PropertyItem, but both of them are
quite distinguishable, so we prefer not to use them as base class for it.
"""
add_permission
=
Permissions
.
AddPortalContent
...
...
@@ -1129,15 +1144,24 @@ class BusinesTemplatePatchItem(XMLObject):
security
=
ClassSecurityInfo
()
security
.
declareObjectProtected
(
Permissions
.
AccessContentsInformation
)
portal_type
=
'Business Patch
i
tem'
portal_type
=
'Business Patch
I
tem'
meta_type
=
'Business Patch Item'
icon
=
None
isIndexable
=
False
isProperty
=
False
constructors
=
(
manage_addBusinessPatchItem
,)
def
__init__
(
self
,
item_path
,
item_sign
,
item_layer
,
old
,
new
,
dependency_list
,
preserved_list
=
None
):
pass
def
build
(
self
,
context
,
**
kw
):
"""
Build should update the old and new value
"""
path
=
self
.
getProperty
(
'item_path'
)
old_value
=
self
.
getOldValue
()
new_value
=
self
.
getNewValue
(
build
=
True
)
self
.
setProperty
(
'old_value'
,
old_value
)
self
.
setProperty
(
'new_value'
,
new_value
)
def
getOldValue
(
self
):
"""
...
...
@@ -1145,9 +1169,10 @@ class BusinesTemplatePatchItem(XMLObject):
"""
pass
def
getNewValue
(
self
):
def
getNewValue
(
self
,
build
=
False
):
"""
Returns new value from the new BM
If build=True, then rebuild the concerned path_item or property_item
"""
pass
...
...
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