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

add a getTranslatedSimulationStateTitle method on simulation movement.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@22864 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0981d179
...@@ -172,6 +172,24 @@ class SimulationMovement(Movement): ...@@ -172,6 +172,24 @@ class SimulationMovement(Movement):
% self.getRelativeUrl()) % self.getRelativeUrl())
return None return None
security.declareProtected( Permissions.AccessContentsInformation,
'getTranslatedSimulationStateTitle')
def getTranslatedSimulationStateTitle(self):
"""Returns translated simulation state title, for user interface, such as
stock browser.
"""
delivery = self.getDeliveryValue()
if delivery is not None:
return delivery.getTranslatedSimulationStateTitle()
order = self.getOrderValue()
if order is not None:
return order.getTranslatedSimulationStateTitle()
# The simulation_state of a simulation movement is calculated by a
# mapping, there's no reliable way of getting the translated title from a
# simulation state ID, so we just return the state ID because we got
# nothing better to return.
return self.getSimulationState()
security.declareProtected( Permissions.AccessContentsInformation, security.declareProtected( Permissions.AccessContentsInformation,
'isAccountable') 'isAccountable')
def isAccountable(self): def isAccountable(self):
......
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