[Erp5-report] r12086 - /erp5/trunk/products/ERP5/Document/AccountingTransaction.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Sun Jan 14 19:05:07 CET 2007
Author: jerome
Date: Sun Jan 14 19:05:03 2007
New Revision: 12086
URL: http://svn.erp5.org?rev=12086&view=rev
Log:
allow deletion of accounting transactions in DevelopmentMode (this "feature"
will probably go away, because now deletion can be managed by workflow)
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=12086&r1=12085&r2=12086&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/AccountingTransaction.py (original)
+++ erp5/trunk/products/ERP5/Document/AccountingTransaction.py Sun Jan 14 19:05:03 2007
@@ -26,7 +26,8 @@
#
##############################################################################
-from Globals import InitializeClass, PersistentMapping
+from Globals import InitializeClass
+from Globals import DevelopmentMode
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface
from Products.CMFCore.utils import getToolByName
@@ -70,9 +71,10 @@
Accounting transactions can only be deleted
in draft or cancelled state
"""
- if self.getSimulationState() not in ("draft", "cancelled") :
- from OFS.ObjectManager import BeforeDeleteException
- raise BeforeDeleteException, \
+ if not DevelopmentMode:
+ if self.getSimulationState() not in ("draft", "cancelled"):
+ from OFS.ObjectManager import BeforeDeleteException
+ raise BeforeDeleteException, \
"%s can only be deleted in draft or cancelled states." % self.getPortalType()
Delivery.manage_beforeDelete(self, item, container)
More information about the Erp5-report
mailing list