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

refuse to delete an Accounting Transaction if it's not in draft or cancelled state.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3539 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 12f08d30
...@@ -118,3 +118,15 @@ An order...""" ...@@ -118,3 +118,15 @@ An order..."""
} }
) )
} }
def manage_beforeDelete(self, item, container):
"""
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, "Accounting Transaction can only be "\
"deleted in draft or cancelled states."
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