diff --git a/product/ERP5/Document/SolverProcess.py b/product/ERP5/Document/SolverProcess.py index 1a172b4433a6e6844c523beb260d240ba769a924..9bb0c955c32174098550f74a9b82f11404167932 100644 --- a/product/ERP5/Document/SolverProcess.py +++ b/product/ERP5/Document/SolverProcess.py @@ -79,12 +79,12 @@ class SolverProcess(XMLObject, ActiveProcess): """ solver_dict = {} movement_dict = {} - types_tool = context.portal_types + types_tool = self.portal_types # First create a mapping between delivery movements and solvers # in order to know for each movements which solvers are needed # and which parameters with - for decision in context.contentValues(portal_type="Solver Decision"): + for decision in self.contentValues(portal_type="Solver Decision"): solver = decision.getSolverValue() solver_type = solver.getId() # ex. Postpone Production Solver solver_conviguration_dict = decision.getConfigurationPropertyDict() @@ -118,7 +118,7 @@ class SolverProcess(XMLObject, ActiveProcess): for solver_key, solver_movement_dict in solver_key_dict.items(): solver_instance = self.newContent(portal_type=solver_type) solver_instance._setDeliveryList(solver_movement_dict.keys()) - for movement_url, configuration_list: + for movement_url, configuration_list in solver_movement_dict.iteritems(): for configuration_kw in configuration_list: solver_instance.updateConfiguration(**configuration_kw) @@ -129,4 +129,4 @@ class SolverProcess(XMLObject, ActiveProcess): Start solving """ for solver in self.contentValues(portal_type=self.getPortalObject().getPortalTargetSolverTypeList()): - solver.activate(active_process=self).solve() \ No newline at end of file + solver.activate(active_process=self).solve()