Commit 16d88e24 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

delivery_solver, start_date and stop_date should be in configuration property...

delivery_solver, start_date and stop_date should be in configuration property dict, not in direct properties.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31379 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4c0283ec
......@@ -68,7 +68,9 @@ class QuantitySplitSolver(SolverMixin, ConfigurableMixin, XMLObject):
for delivery_line in self.getDeliveryValueList():
decision_quantity = delivery_line.getQuantity()
simulation_movement_list = delivery_line.getDeliveryRelatedValueList()
delivery_solver = self.portal_solvers.newDeliverySolver(self.getDeliverySolver(), simulation_movement_list)
configuration_dict = self.getConfigurationPropertyDict()
delivery_solver = self.portal_solvers.newDeliverySolver(
configuration_dict['delivery_solver'], simulation_movement_list)
# Update the quantity using delivery solver algorithm
split_list = delivery_solver.setTotalQuantity(decision_quantity)
# Create split movements
......@@ -77,5 +79,5 @@ class QuantitySplitSolver(SolverMixin, ConfigurableMixin, XMLObject):
batch_mode=True) # Copy at same level
new_movement._setDelivery(None)
new_movement._setQuantity(split_quantity)
new_movement._setStartDate(self.getStartDate())
new_movement._setStopDate(self.getStopDate())
new_movement._setStartDate(configuration_dict['start_date'])
new_movement._setStopDate(configuration_dict['stop_date'])
......@@ -30,24 +30,4 @@
from Products.CMFCore.Expression import Expression
class TargetSolver:
_properties = (
{ 'id': 'delivery_solver',
'type': 'string',
'mode': 'w',
'label': 'Delivery Solver'
},
{ 'id': 'start_date',
'description':'The date when a new movement starts',
'type': 'date',
'mode': 'w',
'label': 'Start Date'
},
{ 'id': 'stop_date',
'description':'The date when a new movement stops',
'type': 'date',
'mode': 'w',
'label': 'Stop Date'
},
)
_categories = ('delivery',)
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