Commit ea7c2d41 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_mrp: get first from previous value

parent b3b1b0d8
...@@ -24,10 +24,14 @@ class DeliveryRuleMovementGenerator(MovementGeneratorMixin): ...@@ -24,10 +24,14 @@ class DeliveryRuleMovementGenerator(MovementGeneratorMixin):
def _getInputMovementList(self, movement_list=None, rounding=None): def _getInputMovementList(self, movement_list=None, rounding=None):
parent_simulation_movement = self._applied_rule.getParentValue().asContext() parent_simulation_movement = self._applied_rule.getParentValue().asContext()
resource_value = parent_simulation_movement.getResourceValue() resource_value = parent_simulation_movement.getResourceValue()
transformation_list = self._applied_rule.getPortalObject().portal_catalog( transformation = parent_simulation_movement.getParentValue().getParentValue().getSpecialiseValue()
portal_type="Transformation", if transformation:
default_resource_uid=resource_value.getUid(), transformation_list = [transformation]
validation_state="validated") else:
transformation_list = self._applied_rule.getPortalObject().portal_catalog(
portal_type="Transformation",
default_resource_uid=resource_value.getUid(),
validation_state="validated")
if len(transformation_list) > 0: if len(transformation_list) > 0:
parent_simulation_movement.setSpecialiseValue(transformation_list[0].getObject(), parent_simulation_movement.setSpecialiseValue(transformation_list[0].getObject(),
portal_type="Transformation") portal_type="Transformation")
......
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