Commit 5a29456d authored by Romain Courteaud's avatar Romain Courteaud

Move specialise Transformation from production order to line.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3499 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6b7bff1e
...@@ -259,9 +259,16 @@ class TransformationRule(Rule): ...@@ -259,9 +259,16 @@ class TransformationRule(Rule):
category_list = parent_movement.getVariationCategoryList( category_list = parent_movement.getVariationCategoryList(
base_category_list=base_category_list) base_category_list=base_category_list)
# Get the transformation to use # Get the transformation to use
production_order = applied_rule.getRootAppliedRule().\ production_order_movement = applied_rule.getRootSimulationMovement().\
getCausalityValue() getOrderValue()
transformation = production_order.getSpecialiseValue( # XXX Acquisition can be use instead
parent_uid = production_order_movement.getParent().getUid()
explanation_uid = production_order_movement.getExplanationUid()
if parent_uid == explanation_uid:
production_order_line = production_order_movement
else:
production_order_line = production_order_movement.getParent()
transformation = production_order_line.getSpecialiseValue(
portal_type=self.getPortalTransformationTypeList()) portal_type=self.getPortalTransformationTypeList())
# Generate the fake context # Generate the fake context
tmp_context = parent_movement.asContext( tmp_context = parent_movement.asContext(
...@@ -272,6 +279,8 @@ class TransformationRule(Rule): ...@@ -272,6 +279,8 @@ class TransformationRule(Rule):
getPreviousPackingListIndustrialPhaseList(current_supply_link) getPreviousPackingListIndustrialPhaseList(current_supply_link)
ind_phase_id_list = [x.getId() for x in previous_ind_phase_list] ind_phase_id_list = [x.getId() for x in previous_ind_phase_list]
# Call getAggregatedAmountList # Call getAggregatedAmountList
# XXX expand failed if transformation is not defined.
# Do we need to catch the exception ?
amount_list = transformation.getAggregatedAmountList( amount_list = transformation.getAggregatedAmountList(
tmp_context, tmp_context,
ind_phase_id_list=ind_phase_id_list) ind_phase_id_list=ind_phase_id_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