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
31bcdb5f
Commit
31bcdb5f
authored
Nov 29, 2017
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Business Commit: Build Business Item object while editing if there has been change in item_path
parent
ddff0b4a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
11 deletions
+20
-11
product/ERP5/Document/BusinessCommit.py
product/ERP5/Document/BusinessCommit.py
+5
-7
product/ERP5/Document/BusinessManager.py
product/ERP5/Document/BusinessManager.py
+12
-4
product/ERP5/Tool/CommitTool.py
product/ERP5/Tool/CommitTool.py
+3
-0
No files found.
product/ERP5/Document/BusinessCommit.py
View file @
31bcdb5f
...
...
@@ -108,19 +108,17 @@ class BusinessCommit(Folder):
PropertySheet
.
Version
,
)
def
getPreviousCommit
(
self
):
return
self
.
prev_commit
security
.
declarePublic
(
'newContent'
)
def
newContent
(
self
,
id
=
None
,
**
kw
):
"""
Override newContent so as to use 'id' generated like hash
Override newContent so as to use 'id' generated like hash.
Also, copy the objects in the Business Commit after creating new object
"""
if
id
is
None
:
id
=
self
.
generateNewId
()
id
=
str
(
str
(
id
)
+
'_'
+
str
(
time
.
time
())).
replace
(
'.'
,
''
)
return
super
(
CommitTool
,
self
).
newContent
(
id
,
**
kw
)
new_object
=
super
(
BusinessCommit
,
self
).
newContent
(
id
,
**
kw
)
import
pdb
;
pdb
.
set_trace
()
def
getCommitHash
(
self
):
return
self
.
commit_hash
return
new_object
product/ERP5/Document/BusinessManager.py
View file @
31bcdb5f
...
...
@@ -713,11 +713,19 @@ class BusinessItem(XMLObject):
"""
Overriden function so that we can update attributes for BusinessItem objects
"""
return
super
(
BusinessItem
,
self
).
_edit
(
item_path
=
item_path
,
super
(
BusinessItem
,
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
import
pdb
;
pdb
.
set_trace
()
if
'item_path'
in
self
.
_v_modified_property_dict
:
self
.
build
(
self
.
aq_parent
)
def
build
(
self
,
context
,
**
kw
):
"""
Extract value for the given path from the OFS
...
...
product/ERP5/Tool/CommitTool.py
View file @
31bcdb5f
...
...
@@ -174,6 +174,9 @@ class CommitTool (BaseTool):
def
getCommitList
(
self
):
return
self
.
objectValues
(
portal_type
=
'Business Commit'
)
def
getSnapshotList
(
self
):
return
self
.
objectValues
(
portal_type
=
'Business Snapshot'
)
security
.
declarePublic
(
'newContent'
)
def
newContent
(
self
,
id
=
None
,
**
kw
):
"""
...
...
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