From 8acf8b05418118174387ee01ff7f6a9153708ac5 Mon Sep 17 00:00:00 2001
From: Julien Muchembled <jm@nexedi.com>
Date: Sat, 2 Oct 2010 20:32:33 +0000
Subject: [PATCH] Fix _aq_dynamic for composed documents

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38853 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/Base.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/product/ERP5Type/Base.py b/product/ERP5Type/Base.py
index c51f803f37..a32ec10ecc 100644
--- a/product/ERP5Type/Base.py
+++ b/product/ERP5Type/Base.py
@@ -898,9 +898,10 @@ class Base( CopyContainer,
       Base.aq_method_generating.append(aq_key)
       try:
         # Proceed with property generation
-        if self.isTempObject():
-          # If self is a temporary object, generate methods for the base
-          # document class rather than for the temporary document class.
+        if self.isTempObject() and len(klass.__bases__) == 1:
+          # If self is a simple temporary object (e.g. not a composed one),
+          # generate methods for the base document class rather than for the
+          # temporary document class.
           # Otherwise, instances of the base document class would fail
           # in calling such methods, because they are not instances of
           # the temporary document class.
-- 
2.30.9