[Erp5-report] r45361 seb - /erp5/trunk/products/ERP5/Document/SimulationMovement.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Wed Apr 13 11:39:34 CEST 2011
Author: seb
Date: Wed Apr 13 11:39:34 2011
New Revision: 45361
URL: http://svn.erp5.org?rev=45361&view=rev
Log:
* isBuildable was looking at all business link associated
to a particular trade phase category, so it was looking
at business link of business process not all related to
this particular simulation movement. So use
asComposedDocument in order to get good list of business
links
* add comments about undocumented and untested code
Modified:
erp5/trunk/products/ERP5/Document/SimulationMovement.py
Modified: erp5/trunk/products/ERP5/Document/SimulationMovement.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/SimulationMovement.py?rev=45361&r1=45360&r2=45361&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/SimulationMovement.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/SimulationMovement.py [utf8] Wed Apr 13 11:39:34 2011
@@ -666,14 +666,16 @@ class SimulationMovement(PropertyRecorda
## XXX Code below following line has been moved to BusinessPath (cf r37116)
#return len(business_path.filterBuildableMovementList([self])) == 1
- predecessor_state = business_link.getPredecessorValue()
+ predecessor_state = business_link.getPredecessor()
if predecessor_state is None:
# first one, can be built
return True # XXX-JPS wrong cause root is marked
# movement is not built, and corresponding business path
# has predecessors: check movements related to those predecessors!
- predecessor_path_list = predecessor_state.getSuccessorRelatedValueList()
+ composed_document = self.asComposedDocument()
+ predecessor_link_list = composed_document.getBusinessLinkValueList(
+ successor=predecessor_state)
def isBuiltAndCompleted(simulation, path):
return simulation.getCausalityValue() is not None and \
@@ -692,7 +694,7 @@ class SimulationMovement(PropertyRecorda
current = current.getParentValue().getParentValue()
remaining_path_set = set()
- for path in predecessor_path_list:
+ for path in predecessor_link_list:
related_simulation = causality_dict.get(path.getRelativeUrl())
if related_simulation is None:
remaining_path_set.add(path)
@@ -709,6 +711,9 @@ class SimulationMovement(PropertyRecorda
if not remaining_path_set:
return True
+ # XXX(Seb) All the code below is not tested and not documented.
+ # Documentation must be written, the code must be reviewed or dropped
+
# But sometimes we have to dig deeper
### Step 2:
More information about the Erp5-report
mailing list