Commit 11d6306d authored by Łukasz Nowak's avatar Łukasz Nowak

- 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
parent f68e68f5
...@@ -60,17 +60,6 @@ class TradeModelRule(TransformationRule): ...@@ -60,17 +60,6 @@ class TradeModelRule(TransformationRule):
, PropertySheet.AppliedRule , 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): def _getMovementDictByBusinessPath(self, movement, business_path_list):
"""Sets Business Path's provided values""" """Sets Business Path's provided values"""
if len(business_path_list) > 1: if len(business_path_list) > 1:
...@@ -121,7 +110,8 @@ class TradeModelRule(TransformationRule): ...@@ -121,7 +110,8 @@ class TradeModelRule(TransformationRule):
"""Generates list of movements (as dicts), and let parent class to decide """Generates list of movements (as dicts), and let parent class to decide
which is to add, modify or delete""" which is to add, modify or delete"""
movement_list = [] 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: if trade_condition is None or bpm is None:
return movement_list return movement_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