From 8756eca32742d01bb78c03833bd89394480bf941 Mon Sep 17 00:00:00 2001
From: Julien Muchembled <jm@nexedi.com>
Date: Wed, 3 Nov 2010 15:18:19 +0000
Subject: [PATCH] Fix import of document classes when portal types as classes
 are used

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39850 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Banking/Document/BankingOperation.py | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/product/ERP5Banking/Document/BankingOperation.py b/product/ERP5Banking/Document/BankingOperation.py
index 7f4247094d..47eafbf098 100755
--- a/product/ERP5Banking/Document/BankingOperation.py
+++ b/product/ERP5Banking/Document/BankingOperation.py
@@ -30,14 +30,23 @@ from Products.CMFCore.utils import getToolByName
 from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
 from Products.ERP5.Document.Delivery import Delivery
 from Products.ERP5.Document.InventoryLine import InventoryLine
-from Products.ERP5Type.Document.DeliveryCell import DeliveryCell
 from Products.ERP5.Document.Movement import Movement
 from Products.ERP5.Document.Container import Container
 from Products.ERP5.Document.AccountingTransaction import AccountingTransaction
 from AccessControl.PermissionRole import PermissionRole
 from Products.ERP5Type.Utils import convertToMixedCase, convertToUpperCase
 from Products.ERP5Banking.BaobabMixin import BaobabMixin
-from Products.ERP5Type.Document.Currency import Currency
+
+# Import classes to monkey-patch
+# XXX All patches must be moved in a Business Template !!
+try:
+  from Products.ERP5Type import dynamic
+except ImportError:
+  from Products.ERP5Type.Document.Currency import Currency
+  from Products.ERP5Type.Document.DeliveryCell import DeliveryCell
+else:
+  from Products.ERP5.Document.Currency import Currency
+  from Products.ERP5.Document.DeliveryCell import DeliveryCell
 
 
 class BankingOperation(BaobabMixin, AccountingTransaction):
-- 
2.30.9