Commit 755acaf5 authored by Guillaume Michon's avatar Guillaume Michon

Added a method to set default values to related simulation movements


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2881 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 06b00e82
...@@ -302,4 +302,15 @@ class DeliveryCell(MappedValue, Movement): ...@@ -302,4 +302,15 @@ class DeliveryCell(MappedValue, Movement):
if kw.has_key('item_id_list'): if kw.has_key('item_id_list'):
self._setItemIdList( kw['item_id_list'] ) self._setItemIdList( kw['item_id_list'] )
security.declareProtected(Permissions.ModifyPortalContent, 'updateSimulationDeliveryProperties')
def updateSimulationDeliveryProperties(self, movement_list = None):
"""
Set properties delivery_ratio and delivery_error for each simulation movement
in movement_list (all movements by default), according to this delivery calculated quantity
"""
parent = self.getParent()
if parent is not None:
parent = parent.getParent()
if parent is not None:
parent.updateSimulationDeliveryProperties(movement_list, self)
...@@ -378,3 +378,12 @@ class DeliveryLine(Movement, XMLObject, XMLMatrix, Variated): ...@@ -378,3 +378,12 @@ class DeliveryLine(Movement, XMLObject, XMLMatrix, Variated):
""" """
return self.getParent().getRootDeliveryValue() return self.getParent().getRootDeliveryValue()
security.declareProtected(Permissions.ModifyPortalContent, 'updateSimulationDeliveryProperties')
def updateSimulationDeliveryProperties(self, movement_list = None):
"""
Set properties delivery_ratio and delivery_error for each simulation movement
in movement_list (all movements by default), according to this delivery calculated quantity
"""
parent = self.getParent()
if parent is not None:
parent.updateSimulationDeliveryProperties(movement_list, 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