From 1786871605061f21dfe9021e5b507533083c7ad7 Mon Sep 17 00:00:00 2001
From: Julien Muchembled <jm@nexedi.com>
Date: Tue, 3 Aug 2010 17:35:18 +0000
Subject: [PATCH] Fix searching of trade model paths having several trade
 phases

git-svn-id: https://svn.erp5.org/repos/public/erp5/sandbox/amount_generator@37455 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/ExplanationCache.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/product/ERP5/ExplanationCache.py b/product/ERP5/ExplanationCache.py
index e92416efc2..e5c9970928 100644
--- a/product/ERP5/ExplanationCache.py
+++ b/product/ERP5/ExplanationCache.py
@@ -188,7 +188,7 @@ class ExplanationCache:
         parent = obj.getParentValue()
         if parent is not None:
           if parent.getPortalType() == "Simulation Movement" and \
-               parent.getCausalityValue().getTradePhase(base=1) == trade_phase:
+             parent.getCausalityValue().isMemberOf(trade_phase, strict_membership=1):
             movement_list.append(parent)
           getParentSimulationMovementValueList(parent, movement_list, trade_phase)
 
@@ -196,7 +196,7 @@ class ExplanationCache:
       child_list = obj.objectValues()
       for child in child_list:
         if child.getPortalType() == "Simulation Movement" and \
-               child.getCausalityValue().getTradePhase(base=1) == trade_phase:
+           child.getCausalityValue().isMemberOf(trade_phase, strict_membership=1):
           movement_list.append(child)
         getChildSimulationMovementValueList(child, movement_list, trade_phase)
 
-- 
2.30.9