Commit 49e20c38 authored by Sebastien Robin's avatar Sebastien Robin

look to a particular script if there is one in getTransformation


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4332 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 31290082
...@@ -106,13 +106,17 @@ class TransformationSourcingRuleMixin(ExtensionClass.Base): ...@@ -106,13 +106,17 @@ class TransformationSourcingRuleMixin(ExtensionClass.Base):
production_order_line = production_order_movement production_order_line = production_order_movement
else: else:
production_order_line = production_order_movement.getParent() production_order_line = production_order_movement.getParent()
line_transformation = production_order_line.objectValues( script = production_order_line._getTypeBaseMethod('_getTransformation')
portal_type=self.getPortalTransformationTypeList()) if script is not None:
if len(line_transformation)==1: transformation = script()
transformation = line_transformation[0]
else: else:
transformation = production_order_line.getSpecialiseValue( line_transformation = production_order_line.objectValues(
portal_type=self.getPortalTransformationTypeList()) portal_type=self.getPortalTransformationTypeList())
if len(line_transformation)==1:
transformation = line_transformation[0]
else:
transformation = production_order_line.getSpecialiseValue(
portal_type=self.getPortalTransformationTypeList())
return transformation return transformation
class TransformationSourcingRule(Rule): class TransformationSourcingRule(Rule):
......
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