[Erp5-report] r25010 - /erp5/trunk/products/ERP5/Document/AccountingTransaction.py

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Jan 5 13:33:16 CET 2009


Author: nicolas
Date: Mon Jan  5 13:33:16 2009
New Revision: 25010

URL: http://svn.erp5.org?rev=25010&view=rev
Log:
Remove source_reference and destination_reference only for Accounting Transaction after cloning

Modified:
    erp5/trunk/products/ERP5/Document/AccountingTransaction.py

Modified: erp5/trunk/products/ERP5/Document/AccountingTransaction.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/AccountingTransaction.py?rev=25010&r1=25009&r2=25010&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/AccountingTransaction.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/AccountingTransaction.py [utf8] Mon Jan  5 13:33:16 2009
@@ -32,6 +32,7 @@
 from Products.CMFCore.utils import getToolByName
 
 from Products.ERP5.Document.Delivery import Delivery
+from Acquisition import aq_base
 
 class AccountingTransaction(Delivery):
     """
@@ -112,7 +113,15 @@
         if prop:
           text_list.append(str(prop))
       return ' '.join(text_list)
-  
+
+    def manage_afterClone(self, transaction):
+        Delivery.manage_afterClone(self, transaction)
+        #Clean some properties
+        if getattr(aq_base(self), 'source_reference', None) is not None:
+          delattr(self, 'source_reference')
+        if getattr(aq_base(self), 'destination_reference', None) is not None:
+          delattr(self, 'destination_reference')
+
 # Compatibility
 # It may be necessary to create an alias after removing the Transaction class
 # Products.ERP5Type.Document.Transaction = AccountingTransaction




More information about the Erp5-report mailing list