Commit e81f1f8f authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

add a missing import.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32045 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e2804b0c
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
import zope.interface import zope.interface
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from Products.CMFCore.utils import getToolByName from Acquisition import aq_base
from Products.ERP5Type import Permissions, PropertySheet, interfaces from Products.ERP5Type import Permissions, PropertySheet, interfaces
from Products.ERP5Type.XMLObject import XMLObject from Products.ERP5Type.XMLObject import XMLObject
from Products.ERP5.mixin.solver import SolverMixin from Products.ERP5.mixin.solver import SolverMixin
...@@ -76,12 +76,19 @@ class QuantitySplitSolver(SolverMixin, ConfigurableMixin, XMLObject): ...@@ -76,12 +76,19 @@ class QuantitySplitSolver(SolverMixin, ConfigurableMixin, XMLObject):
split_list = delivery_solver.setTotalQuantity(decision_quantity) split_list = delivery_solver.setTotalQuantity(decision_quantity)
# Create split movements # Create split movements
for (simulation_movement, split_quantity) in split_list: for (simulation_movement, split_quantity) in split_list:
split_index = 0
new_id = "%s_split_%s" % (simulation_movement.getId(), split_index)
applied_rule = simulation_movement.getParentValue()
while getattr(aq_base(applied_rule), new_id, None) is not None:
split_index += 1
new_id = "%s_split_%s" % (simulation_movement.getId(), split_index)
# Copy at same level # Copy at same level
kw = _getPropertyAndCategoryList(simulation_movement) kw = _getPropertyAndCategoryList(simulation_movement)
kw.update({'portal_type':simulation_movement.getPortalType(), kw.update({'portal_type':simulation_movement.getPortalType(),
'delivery':None, 'id':new_id,
'quantity':split_quantity}) 'delivery':None,
new_movement = simulation_movement.getParentValue().newContent(**kw) 'quantity':split_quantity})
new_movement = applied_rule.newContent(**kw)
start_date = configuration_dict.get('start_date', None) start_date = configuration_dict.get('start_date', None)
if start_date is not None: if start_date is not None:
new_movement.recordProperty('start_date') new_movement.recordProperty('start_date')
......
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