From 11d6306d755a2d909e5ab69634d260625e71881e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C5=81ukasz=20Nowak?= <luke@nexedi.com>
Date: Thu, 30 Apr 2009 15:47:51 +0000
Subject: [PATCH]  - use common implementation to find trade condition and
 business process

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26755 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/Document/TradeModelRule.py | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/product/ERP5/Document/TradeModelRule.py b/product/ERP5/Document/TradeModelRule.py
index dc476a7ab5..0d19f471e0 100644
--- a/product/ERP5/Document/TradeModelRule.py
+++ b/product/ERP5/Document/TradeModelRule.py
@@ -60,17 +60,6 @@ class TradeModelRule(TransformationRule):
                     , PropertySheet.AppliedRule
                     )
 
-  def getSpecialiseList(self, simulation_movement):
-    """Returns (trade_condition, bpm)"""
-    bpm = simulation_movement.getRootAppliedRule().getBusinessProcessValue()
-    causality = simulation_movement.getRootAppliedRule().getCausalityValue()
-    trade_condition = None
-    if causality is not None and getattr(causality, 'getSpecialiseValueList',
-        None) is not None:
-      trade_condition = causality.getSpecialiseValue()
-
-    return trade_condition, bpm
-
   def _getMovementDictByBusinessPath(self, movement, business_path_list):
     """Sets Business Path's provided values"""
     if len(business_path_list) > 1:
@@ -121,7 +110,8 @@ class TradeModelRule(TransformationRule):
     """Generates list of movements (as dicts), and let parent class to decide
     which is to add, modify or delete"""
     movement_list = []
-    trade_condition, bpm = self.getSpecialiseList(applied_rule)
+    trade_condition = applied_rule.getTradeConditionValue()
+    bpm = applied_rule.getBusinessProcessValue()
 
     if trade_condition is None or bpm is None:
       return movement_list
-- 
2.30.9