Commit 050ce9c5 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

IMovementGenerator's getAggregatedMovementList() should return a list of...

IMovementGenerator's getAggregatedMovementList() should return a list of temporary Simulation Movements.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31198 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8e5049d4
...@@ -34,6 +34,7 @@ from AccessControl import ClassSecurityInfo ...@@ -34,6 +34,7 @@ from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, interfaces from Products.ERP5Type import Permissions, PropertySheet, interfaces
from Products.ERP5.Document.Predicate import Predicate from Products.ERP5.Document.Predicate import Predicate
from Products.ERP5.mixin.rule import RuleMixin from Products.ERP5.mixin.rule import RuleMixin
from Products.ERP5.MovementCollectionDiff import _getPropertyAndCategoryList
class NewOrderRule(RuleMixin, Predicate): class NewOrderRule(RuleMixin, Predicate):
""" """
...@@ -106,8 +107,14 @@ class OrderRuleMovementGenerator(object): ...@@ -106,8 +107,14 @@ class OrderRuleMovementGenerator(object):
rounding=False): rounding=False):
"""Input movement list comes from order""" """Input movement list comes from order"""
order = context.getDefaultCausalityValue() order = context.getDefaultCausalityValue()
if order is not None: ret = []
return [x.asContext(order=x.getRelativeUrl()) for x in order.getMovementList( for movement in order.getMovementList(
portal_type=order.getPortalOrderMovementTypeList())] portal_type=order.getPortalOrderMovementTypeList()):
else: kw = _getPropertyAndCategoryList(movement)
return [] simulation_movement = context.newContent(
portal_type=RuleMixin.movement_type,
temp_object=True,
order_value=movement,
**kw)
ret.append(simulation_movement)
return ret
...@@ -89,8 +89,10 @@ class MovementCollectionDiff(object): ...@@ -89,8 +89,10 @@ class MovementCollectionDiff(object):
""" """
property_dict = self._property_dict_dict.get(movement) property_dict = self._property_dict_dict.get(movement)
if property_dict is None: if property_dict is None:
# movement should be 'New Movement' # movement should be 'Temporary Simulation Movement'
return self._getPropertyAndCategoryList(movement) return dict([(x,y) for x,y in movement.__dict__.items() \
if not x.startswith('_') and \
not x in ('id', 'portal_type', 'uid')])
else: else:
return property_dict return property_dict
......
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