Commit 615428c4 authored by Łukasz Nowak's avatar Łukasz Nowak

- 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
parent 8456fbeb
...@@ -483,6 +483,8 @@ class DeliveryLine(Movement, XMLObject, XMLMatrix, Variated, ...@@ -483,6 +483,8 @@ class DeliveryLine(Movement, XMLObject, XMLMatrix, Variated,
# gather delivery relations from simulation movements. # gather delivery relations from simulation movements.
delivery_dict = {} delivery_dict = {}
for s_m in simulation_movement_list: for s_m in simulation_movement_list:
for decision in decision_list:
s_m.appendDecision(decision)
delivery_path = s_m.getDelivery() delivery_path = s_m.getDelivery()
delivery_dict[delivery_path] = \ delivery_dict[delivery_path] = \
delivery_dict.get(delivery_path, []) + \ delivery_dict.get(delivery_path, []) + \
...@@ -504,43 +506,6 @@ class DeliveryLine(Movement, XMLObject, XMLMatrix, Variated, ...@@ -504,43 +506,6 @@ class DeliveryLine(Movement, XMLObject, XMLMatrix, Variated,
def solve(self, decision_list): def solve(self, decision_list):
"""Solves line according to 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 simulation_tool = self.getPortalObject().portal_simulation
solveMovement = simulation_tool.solveMovement solveMovement = simulation_tool.solveMovement
solve_result_list = [] solve_result_list = []
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment