Commit 45148776 authored by Nicolas Delaby's avatar Nicolas Delaby

Remove source_reference and destination_reference only for Accounting Transaction after cloning

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25010 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4c4db943
......@@ -32,6 +32,7 @@ from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface
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 @@ class AccountingTransaction(Delivery):
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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment