From 8aee3f96fc93a37a5f99ad06f2788dfda8deeb3b Mon Sep 17 00:00:00 2001 From: Kazuhiko Shiozaki <kazuhiko@nexedi.com> Date: Thu, 14 Jan 2010 12:59:41 +0000 Subject: [PATCH] use the same solver for accepting and adopting start date divergence. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31749 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5/tests/testERP5Simulation.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/product/ERP5/tests/testERP5Simulation.py b/product/ERP5/tests/testERP5Simulation.py index f502cb8870..2c7be490bb 100644 --- a/product/ERP5/tests/testERP5Simulation.py +++ b/product/ERP5/tests/testERP5Simulation.py @@ -366,6 +366,27 @@ class TestERP5SimulationPackingList(TestERP5SimulationMixin, TestPackingList): solver_process.contentValues()): # use StartDate Replacement Solver. start_date_solver_decision.setSolverValue(self.portal.portal_types['Start Date Replacement Solver']) + # configure for Quantity Split Solver. + kw = {'value':packing_list.getStartDate()} + start_date_solver_decision.updateConfiguration(**kw) + solver_process.buildTargetSolverList() + solver_process.solve() + + def stepUnifyStartDateWithPrevision(self,sequence=None, sequence_list=None, **kw): + """ + Check if simulation movement are disconnected + """ + packing_list = sequence.get('packing_list') + solver_tool = self.portal.portal_solvers + solver_process = solver_tool.newSolverProcess(packing_list) + for start_date_solver_decision in filter( + lambda x:x.getCausalityValue().getTestedProperty()=='start_date', + solver_process.contentValues()): + # use StartDate Replacement Solver. + start_date_solver_decision.setSolverValue(self.portal.portal_types['Start Date Replacement Solver']) + # configure for Quantity Split Solver. + kw = {'value':packing_list.contentValues()[-1].getDeliveryRelatedValue().getStartDate()} + start_date_solver_decision.updateConfiguration(**kw) solver_process.buildTargetSolverList() solver_process.solve() -- 2.30.9