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

getImmobilisationState should not fail if we are not chained to an

immobilisation workflow


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28088 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9c88f08e
......@@ -380,7 +380,11 @@ class ImmobilisationMovement(Movement, XMLObject):
'getImmobilisationState')
def getImmobilisationState(self):
"""
Return root delivery immobilisation state
Return root delivery immobilisation state, or None if this is not chained
to an immobilisation workflow
"""
return self.getRootDeliveryValue().getImmobilisationState()
root_delivery = self.getRootDeliveryValue()
if getattr(root_delivery, 'getImmobilisationState', None) is not None:
return root_delivery.getImmobilisationState()
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