From 86fc5cb40d2563e56454c951a33e9000e93e9696 Mon Sep 17 00:00:00 2001
From: Arnaud Fontaine <arnaud.fontaine@nexedi.com>
Date: Wed, 30 Oct 2013 17:15:44 +0900
Subject: [PATCH] Portal Type as Classes, ZODB Property Sheets: Ensure that
 they are reset on other ZEO clients even if ZODB Components are not.

Steps to reproduce:

  1/ On zope1, view and edit a person to make sure class is fully loaded.
  2/ On zope2 add an interaction in person_interaction_workflow and add a script raising an exception.
  3/ Edit a person on zope2. The exception is raised, confirming that the interaction is called.

  When editing a person on zope1, the exception is not raised.
---
 product/ERP5/ERP5Site.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/product/ERP5/ERP5Site.py b/product/ERP5/ERP5Site.py
index 532a9b3bd3..ed70bf8f0b 100644
--- a/product/ERP5/ERP5Site.py
+++ b/product/ERP5/ERP5Site.py
@@ -358,7 +358,10 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
         # This should only happen before erp5_core is installed
         synchronizeDynamicModules(self)
       else:
-        component_tool.reset()
+        if not component_tool.reset():
+          # Portal Types may have been reset even if Components haven't
+          # (change of Interaction Workflow...)
+          synchronizeDynamicModules(self)
 
     return self
 
-- 
2.30.9