From 49e20c3825f37dc3ae7396b973972654b83d24b8 Mon Sep 17 00:00:00 2001
From: Sebastien Robin <seb@nexedi.com>
Date: Tue, 15 Nov 2005 17:22:59 +0000
Subject: [PATCH] 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
---
 .../ERP5/Document/TransformationSourcingRule.py  | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/product/ERP5/Document/TransformationSourcingRule.py b/product/ERP5/Document/TransformationSourcingRule.py
index b440d6369e..0b5b09df27 100755
--- a/product/ERP5/Document/TransformationSourcingRule.py
+++ b/product/ERP5/Document/TransformationSourcingRule.py
@@ -106,13 +106,17 @@ class TransformationSourcingRuleMixin(ExtensionClass.Base):
       production_order_line = production_order_movement
     else:
       production_order_line = production_order_movement.getParent()
-    line_transformation = production_order_line.objectValues(
-              portal_type=self.getPortalTransformationTypeList())
-    if len(line_transformation)==1:
-      transformation = line_transformation[0]
+    script = production_order_line._getTypeBaseMethod('_getTransformation') 
+    if script is not None:
+      transformation = script()
     else:
-      transformation = production_order_line.getSpecialiseValue(
-                         portal_type=self.getPortalTransformationTypeList())
+      line_transformation = production_order_line.objectValues(
+                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
 
 class TransformationSourcingRule(Rule):
-- 
2.30.9