From d8e9ed19221b8d03e25c860b0d8865af28c0b14e Mon Sep 17 00:00:00 2001
From: Kazuhiko Shiozaki <kazuhiko@nexedi.com>
Date: Thu, 3 Jun 2010 12:05:58 +0000
Subject: [PATCH] get RuleTool and WorkflowTool from a portal to reduce
 _aq_dynamic calls.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35948 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/Document/SimulationMovement.py | 2 +-
 product/ERP5Type/Base.py                    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/product/ERP5/Document/SimulationMovement.py b/product/ERP5/Document/SimulationMovement.py
index c7e29ccf14..6772133783 100644
--- a/product/ERP5/Document/SimulationMovement.py
+++ b/product/ERP5/Document/SimulationMovement.py
@@ -229,7 +229,7 @@ class SimulationMovement(Movement, PropertyRecordableMixin):
     a delivery,
     finally, apply new rules if no rule with the same type is already applied.
     """
-    portal_rules = getToolByName(self, 'portal_rules')
+    portal_rules = getToolByName(self.getPortalObject(), 'portal_rules')
 
     tv = getTransactionalVariable(self)
     cache = tv.setdefault(TREE_DELIVERED_CACHE_KEY, {})
diff --git a/product/ERP5Type/Base.py b/product/ERP5Type/Base.py
index 6201dd0cff..d798e08fd9 100644
--- a/product/ERP5Type/Base.py
+++ b/product/ERP5Type/Base.py
@@ -168,7 +168,7 @@ class WorkflowMethod(Method):
 
     # New implementation does not use any longer wrapWorkflowMethod
     # but directly calls the workflow methods
-    wf = getToolByName(instance, 'portal_workflow', None)
+    wf = getToolByName(instance.getPortalObject(), 'portal_workflow', None)
 
     if wf is None:
       # XXX instance is unwrapped(no acquisition)
-- 
2.30.9