Commit cd9cb478 authored by Jérome Perrin's avatar Jérome Perrin

allow deletion of accounting transactions in DevelopmentMode (this "feature"

will probably go away, because now deletion can be managed by workflow)



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12086 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent debb359d
...@@ -26,7 +26,8 @@ ...@@ -26,7 +26,8 @@
# #
############################################################################## ##############################################################################
from Globals import InitializeClass, PersistentMapping from Globals import InitializeClass
from Globals import DevelopmentMode
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface
from Products.CMFCore.utils import getToolByName from Products.CMFCore.utils import getToolByName
...@@ -70,9 +71,10 @@ class AccountingTransaction(Delivery): ...@@ -70,9 +71,10 @@ class AccountingTransaction(Delivery):
Accounting transactions can only be deleted Accounting transactions can only be deleted
in draft or cancelled state in draft or cancelled state
""" """
if self.getSimulationState() not in ("draft", "cancelled") : if not DevelopmentMode:
from OFS.ObjectManager import BeforeDeleteException if self.getSimulationState() not in ("draft", "cancelled"):
raise BeforeDeleteException, \ from OFS.ObjectManager import BeforeDeleteException
raise BeforeDeleteException, \
"%s can only be deleted in draft or cancelled states." % self.getPortalType() "%s can only be deleted in draft or cancelled states." % self.getPortalType()
Delivery.manage_beforeDelete(self, item, container) Delivery.manage_beforeDelete(self, item, container)
......
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