Commit cf7416da authored by Nicolas Delaby's avatar Nicolas Delaby

remove hardcoded WorkflowMethod

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16788 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2f458f82
...@@ -77,30 +77,8 @@ class ImmobilisationDelivery(XMLObject): ...@@ -77,30 +77,8 @@ class ImmobilisationDelivery(XMLObject):
, PropertySheet.Reference , PropertySheet.Reference
) )
def validate_immobilisation(self, **kw):
LOG("ImmobilisationDelivery", WARNING,
"validate_immobilisation is deprecated. " \
"Use validateImmobilisation instead")
self.validateImmobilisation()
def invalidate_immobilisation(self, **kw):
LOG("ImmobilisationDelivery", WARNING,
"invalidate_immobilisation is deprecated. " \
"Use invalidateImmobilisation instead")
self.invalidateImmobilisation()
def calculate_immobilisation_validity(self, **kw):
LOG("ImmobilisationDelivery", WARNING,
"calculate_immobilisation_validity is deprecated. " \
"Use calculateImmobilisationValidity instead")
self.calculateImmobilisationValidity()
validate_immobilisation = WorkflowMethod(validate_immobilisation)
invalidate_immobilisation = WorkflowMethod(invalidate_immobilisation)
calculate_immobilisation_validity = WorkflowMethod(calculate_immobilisation_validity)
security.declareProtected(Permissions.View, 'updateImmobilisationState') security.declareProtected(Permissions.View, 'updateImmobilisationState')
def updateImmobilisationState(self,**kw): def updateImmobilisationState(self, **kw):
""" """
This is often called as an activity, it will check if the This is often called as an activity, it will check if the
delivery is valid as an immobilisation movement, and if so delivery is valid as an immobilisation movement, and if so
...@@ -110,20 +88,11 @@ class ImmobilisationDelivery(XMLObject): ...@@ -110,20 +88,11 @@ class ImmobilisationDelivery(XMLObject):
if self.getImmobilisationState() == 'calculating': if self.getImmobilisationState() == 'calculating':
try: try:
if self.isValidImmobilisationMovement(**kw): if self.isValidImmobilisationMovement(**kw):
self.validate_immobilisation() self.validateImmobilisation()
else: else:
self.invalidate_immobilisation() self.invalidateImmobilisation()
except ImmobilisationValidityError: except ImmobilisationValidityError:
self.calculate_immobilisation_validity() self.calculateImmobilisationValidity()
security.declareProtected(Permissions.View, 'getImmobilisationState')
def getImmobilisationState(self, id_only=1):
"""
Returns the current state in immobilisation validity
"""
portal_workflow = getToolByName(self, 'portal_workflow')
wf = portal_workflow.getWorkflowById('immobilisation_workflow')
return wf._getWorkflowStateOf(self, id_only=id_only)
security.declareProtected(Permissions.View, 'getImmobilisationMovementList') security.declareProtected(Permissions.View, 'getImmobilisationMovementList')
def getImmobilisationMovementList(self, **kw): def getImmobilisationMovementList(self, **kw):
......
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