Index: main/plugin-odf/src/org/ametys/odf/course/actions/AbstractOdfAction.java
===================================================================
--- main/plugin-odf/src/org/ametys/odf/course/actions/AbstractOdfAction.java	(revision 55268)
+++ main/plugin-odf/src/org/ametys/odf/course/actions/AbstractOdfAction.java	(working copy)
@@ -80,25 +80,35 @@
         // Back up to first parent of type Program or Course
         WorkflowAwareContent parent = (WorkflowAwareContent) getParentProgramOrCourse (ao);
         
+        applyChanges(parent);
+    }
+    
+    /**
+     * Back up to content and apply changes
+     * @param content the content which has some changes
+     * @throws WorkflowException 
+     */
+    protected void applyChanges(WorkflowAwareContent content) throws WorkflowException
+    {
         // Save changes
-        parent.saveChanges();
-        if (parent instanceof VersionableAmetysObject)
+        content.saveChanges();
+        if (content instanceof VersionableAmetysObject)
         {
             // Create new version
-            ((VersionableAmetysObject) parent).checkpoint();
+            ((VersionableAmetysObject) content).checkpoint();
         }
         
         // Notify listeners
-        _observationManager.notify(new Event(_getCurrentUser(), ObservationConstants.CONTENT_MODIFIED, parent));
+        _observationManager.notify(new Event(_getCurrentUser(), ObservationConstants.CONTENT_MODIFIED, content));
        
         // Do workflow action
         Map<String, Object> inputs = new HashMap<String, Object>();
         inputs.put(AbstractContentWorkflowComponent.RESULT_MAP_KEY, new HashMap<String, Object>());
-        inputs.put(AbstractContentWorkflowComponent.CONTENT_KEY, parent);
-        _workflow.doAction(parent.getWorkflowId(), 22, inputs);
+        inputs.put(AbstractContentWorkflowComponent.CONTENT_KEY, content);
+        _workflow.doAction(content.getWorkflowId(), 22, inputs);
         
-        Step currentStep = (Step) _workflow.getCurrentSteps(parent.getWorkflowId()).iterator().next();
-        parent.setCurrentStepId(currentStep.getStepId());
-        parent.saveChanges();
+        Step currentStep = (Step) _workflow.getCurrentSteps(content.getWorkflowId()).iterator().next();
+        content.setCurrentStepId(currentStep.getStepId());
+        content.saveChanges();
     }
 }
Index: main/plugin-odf/src/org/ametys/odf/orgunit/actions/DeleteOrgUnitAction.java
===================================================================
--- main/plugin-odf/src/org/ametys/odf/orgunit/actions/DeleteOrgUnitAction.java	(revision 55268)
+++ main/plugin-odf/src/org/ametys/odf/orgunit/actions/DeleteOrgUnitAction.java	(working copy)
@@ -16,6 +16,7 @@
 package org.ametys.odf.orgunit.actions;
 
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import javax.jcr.RepositoryException;
@@ -32,6 +33,8 @@
 import org.ametys.plugins.repository.AmetysObjectIterable;
 import org.ametys.plugins.repository.query.expression.Expression;
 
+import com.opensymphony.workflow.WorkflowException;
+
 /**
  * Delete a {@OrgUnit}
  */
@@ -50,7 +53,29 @@
     @Override
     protected void doSpecificBeforeDeletion(Content content) throws RepositoryException
     {
-        // Nothing
+        if (content instanceof OrgUnit)
+        {
+            OrgUnit orgUnit = (OrgUnit) content;
+            
+            OrgUnit parentOrgUnit = orgUnit.getParentOrgUnit();
+            if (parentOrgUnit != null)
+            {
+                // Remove parent orgUnit reference to deleted child
+                List<String> subOrgUnits = parentOrgUnit.getSubOrgUnits();
+                subOrgUnits.remove(orgUnit.getId());
+                
+                parentOrgUnit.getMetadataHolder().setMetadata(OrgUnit.ORGUNITS_REFERENCES, subOrgUnits.toArray(new String[subOrgUnits.size()]));
+                
+                try
+                {
+                    applyChanges(parentOrgUnit);
+                }
+                catch (WorkflowException e)
+                {
+                    getLogger().error("Can't apply change to parent orgUnit " + parentOrgUnit.getId(), e);
+                }
+            }
+        }
     }
     
     @Override
