Index: main/plugin-odf-sync/src/org/ametys/plugins/odfsync/apogee/AbstractApogeeManager.java =================================================================== --- main/plugin-odf-sync/src/org/ametys/plugins/odfsync/apogee/AbstractApogeeManager.java (revision 18138) +++ main/plugin-odf-sync/src/org/ametys/plugins/odfsync/apogee/AbstractApogeeManager.java (working copy) @@ -321,10 +321,11 @@ * @param remoteProgram the remote subprogram * @param report The report for logs * @param importMode true to it is the import mode + * @return true if changes were made * @throws AmetysRepositoryException * @throws WorkflowException */ - public void synchronizeSubProgramOrgUnits (SubProgram subprogram, ApogeeSubProgramRemoteItem remoteProgram, SynchronizationReport report, boolean importMode) throws AmetysRepositoryException, WorkflowException + public boolean synchronizeSubProgramOrgUnits (SubProgram subprogram, ApogeeSubProgramRemoteItem remoteProgram, SynchronizationReport report, boolean importMode) throws AmetysRepositoryException, WorkflowException { Map ouParams = new HashMap(); ouParams.put(ApogeeOrgUnitRemoteItem.COD_CMP, remoteProgram.getCmpCode()); @@ -336,7 +337,7 @@ { ouReferences.add(ou.getId()); } - ApogeeSynchronizationHelper.synchronizeStringArrayMetadata(subprogram, AbstractProgram.ORG_UNITS_REFERENCES, ouReferences.toArray(new String[ouReferences.size()]), importMode); + return ApogeeSynchronizationHelper.synchronizeStringArrayMetadata(subprogram, AbstractProgram.ORG_UNITS_REFERENCES, ouReferences.toArray(new String[ouReferences.size()]), importMode); } /** Index: main/plugin-odf-sync/src/org/ametys/plugins/odfsync/apogee/ApogeeSynchronizationManager.java =================================================================== --- main/plugin-odf-sync/src/org/ametys/plugins/odfsync/apogee/ApogeeSynchronizationManager.java (revision 18100) +++ main/plugin-odf-sync/src/org/ametys/plugins/odfsync/apogee/ApogeeSynchronizationManager.java (working copy) @@ -779,7 +779,10 @@ else { // Metadata - hasChanges = synchronizeSubProgramFields(subProgram, remoteSubProgram, report, true); + hasChanges = synchronizeSubProgramFields(subProgram, remoteSubProgram, report, false); + + // OrgUnits + hasChanges = synchronizeSubProgramOrgUnits(subProgram, remoteSubProgram, report, false) || hasChanges; // Copy the synchronized values into the translations. synchronizeTranslations(subProgram, report, logger);