Commit 98844701 authored by Romain Courteaud's avatar Romain Courteaud

Check if delivery_value is empty on simulation movement, before storing a new

value.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3483 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c71fc550
......@@ -106,13 +106,14 @@ class DeliveryBuilder(OrderBuilder):
self, delivery_movement,
simulation_movement, property_dict,
update_existing_movement=update_existing_movement)
# Check if simulation movement is not already linked to a existing
# movement
if simulation_movement.getDeliveryValue() is not None:
raise "SelectMovementError",\
"simulation_movement '%s' must not be selected !" %\
simulation_movement.getRelativeUrl()
# Update simulation movement
#simulation_movement.setDeliveryValue(delivery_movement)
simulation_movement.edit(delivery_value=delivery_movement)
# To update the divergence status, the simulation movement must be reindexed
# and the delivery must be touched.
#simulation_movement.immediateReindexObject()
#delivery_movement.activate(after_path_and_method_id = (simulation_movement.getPath(), ['immediateReindexObject', 'recursiveImmediateReindexObject'])).edit()
# Simulation consistency propagation
security.declareProtected(Permissions.ModifyPortalContent,
......
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