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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Aaron Chen
erp5
Commits
cc18a344
Commit
cc18a344
authored
May 24, 2013
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ExplanationCache: do not create new business link closure if unnecessary
Also do not hardcode 'business_process_module'.
parent
bdb5085a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
18 deletions
+25
-18
product/ERP5/ExplanationCache.py
product/ERP5/ExplanationCache.py
+25
-18
No files found.
product/ERP5/ExplanationCache.py
View file @
cc18a344
...
...
@@ -264,24 +264,31 @@ class ExplanationCache:
path_list.sort()
path_list = tuple(path_list)
new_business_process = self.closure_cache.get(path_list)
if new_business_process is not None:
self.closure_cache[business_link] = new_business_process
return new_business_process
# Build a new closure business process
module = business_process.getPortalObject().business_process_module # XXX-JPS
self.closure_cache[business_link] = self.closure_cache[path_list] =
\
new_business_process = module.newContent(portal_type="Business Process",
temp_object=True) # XXX-JPS is this really OK with union business processes
i = 0
for business_link in business_process.getBusinessLinkValueList():
if new_business_process is None:
business_link_list = []
new_business_process = business_process
for x in business_process.getBusinessLinkValueList():
if self.getSimulationMovementValueList(path=path_list,
causality_uid=business_link
.getUid()):
causality_uid=x
.getUid()):
# We have matching movements.
i += 1
business_link_list.append(x)
else:
new_business_process = None
if new_business_process is None:
# Build a new closure business process.
# Initially, business_process is often the result of
# asComposedDocument() and business_process.getParentValue() is not a
# module where newContent() allows creation of Business Processes.
# XXX-JPS is this really OK with union business processes
from Products.ERP5Type.Document import newTempBusinessProcess
new_business_process = newTempBusinessProcess(
self.explanation, '
closure_business_process
')
for i, x in enumerate(business_link_list):
id = '
closure_path_
%
s
' % i
new_business_process._setOb(id, business_link.asContext(id=id))
new_business_process._setOb(id, x.asContext(id=id))
self.closure_cache[path_list] = new_business_process
self.closure_cache[business_link] = new_business_process
return new_business_process
def getUnionBusinessProcess(self):
...
...
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