diff --git a/bt5/erp5_simulation/SkinTemplateItem/portal_skins/erp5_simulation/Delivery_updateSolveDivergenceDialog.py b/bt5/erp5_simulation/SkinTemplateItem/portal_skins/erp5_simulation/Delivery_updateSolveDivergenceDialog.py index 25dbbf561a7da08000b4f40ddfbce758bbd0f529..eb5735bc51d41313d837f5711ac44fe44f05344f 100644 --- a/bt5/erp5_simulation/SkinTemplateItem/portal_skins/erp5_simulation/Delivery_updateSolveDivergenceDialog.py +++ b/bt5/erp5_simulation/SkinTemplateItem/portal_skins/erp5_simulation/Delivery_updateSolveDivergenceDialog.py @@ -1,16 +1,14 @@ request = context.REQUEST from Products.ERP5Type.Message import translateString -listbox = request.get('listbox') line_list = context.Delivery_getSolverDecisionList(listbox=listbox) if len(line_list) == 0: kw["keep_items"] = {'portal_status_message': translateString("Workflow state may have been updated by other user. Please try again.")} return context.Base_redirect(form_id, **kw) -for listbox_key in listbox: - listbox_dict = listbox[listbox_key] - line = [x for x in line_list if x.getPath() == listbox_key][0] +for listbox_dict in listbox: + line = [x for x in line_list if x.getPath() == listbox_dict['listbox_key']][0] uid = line.getUid() for prop in ('solver', 'solver_configuration', 'delivery_solver', 'comment',): value = listbox_dict.get(prop, None) diff --git a/product/ERP5/tests/testERP5Simulation.py b/product/ERP5/tests/testERP5Simulation.py index d25b0a7a618b3e1f3105caf00a215fcd3482c5e7..93dd6fde21d6b9b095225702062bd7d2dbe3ff1e 100644 --- a/product/ERP5/tests/testERP5Simulation.py +++ b/product/ERP5/tests/testERP5Simulation.py @@ -359,17 +359,17 @@ class TestERP5Simulation(TestPackingListMixin, SecurityTestCase): # Choose 'Divergence Resolution' (Adopt Prevision) solver_decision = solver_decision_list[0] - packing_list.REQUEST['listbox'] = { - solver_decision.getPath(): - {'comment': '', + listbox = [{ + 'listbox_key':solver_decision.getPath(), + 'comment': '', 'solver_configuration': DummySolverConfiguration(), - 'solver': 'portal_solvers/Adopt Solver'}} + 'solver': 'portal_solvers/Adopt Solver'}] - packing_list.Delivery_updateSolveDivergenceDialog() + packing_list.Delivery_updateSolveDivergenceDialog(listbox=listbox) # Solve Divergences self.assertEqual( - self._getPortalStatusMessage(packing_list.Delivery_submitSolveDivergenceDialog()), + self._getPortalStatusMessage(packing_list.Delivery_submitSolveDivergenceDialog(listbox=listbox)), 'Divergence solvers started in background.') # SolverProcess.solve() called @@ -394,18 +394,18 @@ class TestERP5Simulation(TestPackingListMixin, SecurityTestCase): self.assertEqual(len(packing_list.getSolverValueList()), 1) self.assertEqual(len(packing_list.Delivery_getSolverDecisionList()), 0) - packing_list.REQUEST['listbox'] = { - solver_decision.getPath(): - {'comment': '', + listbox = [{ + 'listbox_key':solver_decision.getPath(), + 'comment': '', 'solver_configuration': DummySolverConfiguration(), - 'solver': 'portal_solvers/Adopt Solver'}} + 'solver': 'portal_solvers/Adopt Solver'}] self.assertEqual( - self._getPortalStatusMessage(packing_list.Delivery_updateSolveDivergenceDialog()), + self._getPortalStatusMessage(packing_list.Delivery_updateSolveDivergenceDialog(listbox=listbox)), 'Workflow state may have been updated by other user. Please try again.') self.assertEqual( - self._getPortalStatusMessage(packing_list.Delivery_submitSolveDivergenceDialog()), + self._getPortalStatusMessage(packing_list.Delivery_submitSolveDivergenceDialog(listbox=listbox)), 'Workflow state may have been updated by other user. Please try again.') self.tic()