[Erp5-report] r39850 jm - /erp5/trunk/products/ERP5Banking/Document/BankingOperation.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Nov 3 16:18:19 CET 2010


Author: jm
Date: Wed Nov  3 16:18:19 2010
New Revision: 39850

URL: http://svn.erp5.org?rev=39850&view=rev
Log:
Fix import of document classes when portal types as classes are used

Modified:
    erp5/trunk/products/ERP5Banking/Document/BankingOperation.py

Modified: erp5/trunk/products/ERP5Banking/Document/BankingOperation.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Banking/Document/BankingOperation.py?rev=39850&r1=39849&r2=39850&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Banking/Document/BankingOperation.py [utf8] (original)
+++ erp5/trunk/products/ERP5Banking/Document/BankingOperation.py [utf8] Wed Nov  3 16:18:19 2010
@@ -30,14 +30,23 @@ from Products.CMFCore.utils import getTo
 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):




More information about the Erp5-report mailing list