From 615428c4e2299d7957f6a0bd48e9282427671e20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Nowak?= <luke@nexedi.com> Date: Thu, 3 Sep 2009 13:25:04 +0000 Subject: [PATCH] - append decision list in case of adopting prevision - remove explanatory docstring, documentation moved as tests to testBPMEvaluation in r28786 git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28787 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5/Document/DeliveryLine.py | 39 ++------------------------- 1 file changed, 2 insertions(+), 37 deletions(-) diff --git a/product/ERP5/Document/DeliveryLine.py b/product/ERP5/Document/DeliveryLine.py index 965e69ee25..331e8f5d62 100644 --- a/product/ERP5/Document/DeliveryLine.py +++ b/product/ERP5/Document/DeliveryLine.py @@ -483,6 +483,8 @@ class DeliveryLine(Movement, XMLObject, XMLMatrix, Variated, # gather delivery relations from simulation movements. delivery_dict = {} for s_m in simulation_movement_list: + for decision in decision_list: + s_m.appendDecision(decision) delivery_path = s_m.getDelivery() delivery_dict[delivery_path] = \ delivery_dict.get(delivery_path, []) + \ @@ -504,43 +506,6 @@ class DeliveryLine(Movement, XMLObject, XMLMatrix, Variated, def solve(self, decision_list): """Solves line according to decision list """ - - """How to play -delivery_line = context -from DateTime import DateTime -from Products.ERP5.DivergenceSolutionDecision import DivergenceSolutionDecision -decision_list = [] - -# adopt -for d in context.getDivergenceList(): - decision = DivergenceSolutionDecision(d, 'adopt', None, None) - decision_list.append(decision) - -delivery_line.solve(decision_list) -return 'ok' - -# split -for d in delivery_line.getDivergenceList(): - if d.tested_property == 'quantity': - split_kw = {} - split_kw.update(start_date = DateTime('2009/01/01'), - stop_date = DateTime('2009/01/10')) - decision = DivergenceSolutionDecision(d, 'split', None, 'SplitAndDefer', - split_kw = split_kw) - decision_list.append(decision) - -delivery_line.solve(decision_list) -return 'ok' - -# adopt -for d in delivery_line.getDivergenceList(): - if d.tested_property == 'quantity': - decision = DivergenceSolutionDecision(d, 'adopt', None, None) - decision_list.append(decision) - -delivery_line.solve(decision_list) -return 'ok' - """ simulation_tool = self.getPortalObject().portal_simulation solveMovement = simulation_tool.solveMovement solve_result_list = [] -- 2.30.9