Issues #701 (model and portal enrolment), #702 (ranking and selection), #703 (participants’
files and documents) and #704 (leader panel, follow-up, coordinator overview), all on branch
ems-movgrupo. The individual modalities (internships, staff) are in erasmus.md.
A group mobility is a group of students of one or more real EMS groups (e.g. the two morning groups of SMX2) that goes abroad together with its accompanying teachers, one of them the leader teacher. It is a third Erasmus+ modality next to the internship and staff calls, with a much simpler procedure: the students enrol from the portal with one click (no CV, letter, video nor interview), EMS ranks them when the enrolment closes, the leader teacher prepares the proposal and the Erasmus coordinator approves it. Then every participant gets a file on the same document engine as the other modalities. The four mobilities the centre starts with (SMX2 and 2GA, morning and afternoon, 8 students and 2 teachers each) are plain configuration: nothing in the code knows about them.
erDiagram
ems_erasmus_group_mobility }o--|| ems_erasmus_project : "project_id (KA121-VET)"
ems_erasmus_group_mobility }o--o{ ems_group : "group_ids (eligible)"
ems_erasmus_group_mobility }o--|| hr_employee : "leader_id"
ems_erasmus_group_mobility }o--o{ hr_employee : "companion_ids"
ems_erasmus_group_mobility ||--o{ ems_erasmus_group_registration : "registration_ids"
ems_erasmus_group_mobility ||--o{ ems_erasmus_group_participant : "participant_ids"
ems_erasmus_group_mobility ||--o{ ems_erasmus_call_document : "requirement_ids"
ems_erasmus_group_mobility ||--o{ ems_erasmus_application_document : "document_ids (shared)"
ems_erasmus_group_mobility ||--o{ ems_erasmus_group_log : "log_ids"
ems_erasmus_group_mobility ||--o{ ems_erasmus_group_draw : "draw_ids"
ems_erasmus_group_draw ||--o{ ems_erasmus_group_draw_line : "line_ids (position)"
ems_erasmus_group_draw_line }o--|| ems_erasmus_group_registration : "registration_id"
ems_erasmus_group_mobility ||--o{ ems_erasmus_invoice : "invoice_ids (collective expenses)"
ems_erasmus_group_mobility ||--o{ ems_erasmus_resolution : "resolution_ids (provisional, definitive)"
ems_erasmus_resolution ||--o{ ems_erasmus_resolution_line : "line_ids"
ems_erasmus_resolution_line }o--|| ems_erasmus_group_registration : "group_registration_id"
ems_erasmus_group_registration }o--|| res_partner : "partner_id (student)"
ems_erasmus_group_registration |o--o| ems_erasmus_group_participant : "participant_id"
ems_erasmus_group_participant ||--o{ ems_erasmus_application_document : "document_ids (own)"
ems_erasmus_application_document }o--|| ems_erasmus_call_document : "call_document_id"
| Model | Purpose |
|---|---|
ems.erasmus.group.mobility |
The group mobility: project, eligible groups (group_ids, real ems.group records; shift only filters the choice), places for students and teachers, leader and other accompanying teachers, enrolment period and published selection criteria (tie_break), destination and host entity, planned and final dates, travel dates, programme, state, the selection’s evidence (ranking, proposal and approval dates and users), EU Survey and closure. |
ems.erasmus.group.registration |
A student’s enrolment (unique per mobility and student, kept when withdrawn), the data frozen when the enrolment closes, the ranking, the result and the substitutions. Selection evidence, not the travel file. |
ems.erasmus.group.participant |
A participant’s file: each selected student, the leader and the accompanying teachers (role). Teachers join without any staff call. A student’s commitment letter (below) lives here. |
ems.erasmus.group.draw / .draw.line |
One record per tie the coordinator drew: who (user_id), when (date), what the students were tied on (grade_average, fewer_opportunities), the exact set tied and the order drawn (line_ids: enrolment, student, position). Created by EMS only; write and unlink refuse (except on module uninstall). Since audit D-13 an individual call’s draws are kept in the same model (call_id, score_total, lines with application_id; _ems_run() runs both). |
ems.erasmus.commitment (abstract) |
The commitment letter mechanism shared with the internship mobilities (ems.erasmus.mobility): signature fields of the student and of the family, action_sign_commitment, _ems_remind_guardians. |
ems.erasmus.resolution / .line |
The calls’ resolutions, reused for the group’s provisional and definitive lists: a resolution has a call or a group mobility (SQL CHECK), a line an application or a group enrolment (group_registration_id). Extended with _inherit in group_mobility.py. |
ems.erasmus.group.log |
The follow-up written by the group’s teachers: attendance (who was absent), incidents (apart from the academic conduct warnings, ems.strike), changes, evidence, communications, with files. |
States of the mobility: draft → enrolment → selection → validation → preparation →
stay → return → done (or cancelled). The participants’ files exist from preparation.
description, with the code view of ems_html_codeview, see
erasmus.md’s Portal section), and opens the
enrolment (action_open_enrolment, which refuses without groups, period or criteria). Dates
and destination may stay empty until they are confirmed./my/erasmus shows a card per group mobility the student can see
(res.partner._ems_erasmus_group_mobilities: enrolling for one of their groups, or one they
enrolled in or take part in). One button enrols (POST /my/erasmus/group/<id>/enrol), another
withdraws while the period is open. An optional tick declares a situation of fewer
opportunities: only the Erasmus team sees it and accredits it (fewer_opportunities_check).
No file is uploaded at this point: a confidential file on the enrolment would be readable by
the leader through its attachment, so the evidence goes, if needed, to the confidential
“Group inclusion documentation” or is checked by the team outside EMS.ems.erasmus.group.registration._ems_portal_enrol): student of an eligible group,
enrolment open (is_enrolling: state and period) and no duplicate. Conduct warnings never stop
enrolling (adriamt, 2026-11-03, as in the calls): the coordinator excludes by hand with the
result exception and its reason. The routes never take a partner or an
enrolment id from the form: the student is always the logged-in user’s partner._cron_close_enrolments, or the coordinator’s
button), _ems_freeze copies onto each enrolment the main group at that moment, the record
average and this course’s conduct warnings (shown to the team only), and decides eligibility
(exclusion: not in an eligible group). These values are never recomputed.ems.erasmus.application._ems_partner_grade_values
and _ems_grade_average (extracted from the application without changing them).grade_found false). If they
are eligible, the enrolment is a grade incident (grade_incident, stored): not ranked
(rank 0, no proposed result), counted on the mobility (grade_incidents, a red banner) and it
blocks both the proposal and the approval (_ems_check_selection_ready). It is resolved
either by the Erasmus team entering the average by hand (grade_manual,
grade_average_manual 0-10, grade_manual_reason required, all tracked; the ranking then uses
it through _ems_average) or by the coordinator excluding the student (result_override =
excluded, with its reason)._ems_rank orders the eligible enrolments by score (descending, issue #773, art. 16 of the
students’ rules), then the fewer opportunities accredited by the team, then a draw (decided by
the coordinator, 2026-10-24). score (stored) = _ems_average() + 1 if
fewer_opportunities_check == 'yes' - 0.5 per frozen conduct warning, at most 1.5
(FEWER_OPPORTUNITIES_POINTS, STRIKE_POINTS, STRIKE_POINTS_MAX); it follows the team’s later
checks (an accreditation, an average entered by hand). The leader reads score, never
strike_count nor fewer_opportunities_check (field groups, audit D-14). A mobility ranked before
#773 has rank_by_score False (set by the upgrade where ranking_date was set) and keeps ranking
by the average: _ems_ranking_score() is what the ranking, the draw (score_total) and the
published lines (score_total, the PDF’s header Score/Average) use.
A remaining tie is flagged (needs_draw) and blocks the proposal until the Erasmus
coordinator runs the draw (action_draw_ties): EMS orders each tied set at random with a
cryptographically secure generator (secrets.SystemRandom), stores the position in
draw_order (read-only) and keeps an ems.erasmus.group.draw per tied set (who, when, the
values tied on, the exact students and the order drawn; the mobility’s Selection tab lists them),
also summed up in the chatter. It only touches tied enrolments. A tie is the same
_ems_tie_key (score, accreditation); it counts as resolved while everyone in it has a
different draw_order, so a student who joins an already drawn tie later (an average entered
by hand, an accreditation) reopens it for a new draw, which is recorded as another draw. A declared situation of fewer
opportunities still pending verification blocks the proposal too. The first ones, as many as
places, are proposed as selected, the rest as reserves in order; the non-eligible, as excluded
(“excluded” and “no place” are different results).
A student the coordinator excludes with an exception (result_override = excluded) is out of
the ranking too (rank 0, proposed excluded), so their place goes to the next one; setting the
exception re-ranks (write of result_override).groups= Erasmus team/admin) and sends the proposal (action_submit_proposal). The
leader cannot change grades, ranks or results; they can write an exception request with its
reason, which becomes a task for the coordinator.ems.group_erasmus_coordinator) or the administrator publishes the
lists, approves, sends the proposal back with a reason, or sets an exception (result_override, a
reason required, tracked).ems.erasmus.resolution) as they are: frozen lines, only the masked identity
document published (mask_document_id), rank, record average (its column reads Average, not the calls’ Score) and result, the exclusion reason
only for the student, a PDF kept for the dossier. action_publish_provisional (state
validation, a future claims_deadline required) creates, prepares and publishes the
provisional list from the proposal with its exceptions (_ems_list_result); each student gets
email_template_erasmus_resolution_published (the calls’ template) and claims from the portal. action_approve_selection refuses until the provisional list is published
and its claims_deadline has passed, with every claim answered (as the calls’ definitive resolution);
it freezes result, publishes the definitive list, opens the files and emails each student
their own result (email_template_erasmus_group_result, so the definitive list sends no
second email). The resolution’s call-specific parts are hooks the group overrides
(_ems_check_can_prepare, _ems_check_can_publish, _ems_after_publish, _ems_line_values,
_ems_list_groups). Publishing needs every enrolled student’s identity document (DNI/NIE, else
passport), as in the calls. Claims are the calls’ ems.erasmus.claim, extended here: a
claim belongs to an application or to a group enrolment (group_registration_id, SQL check
one_owner), partner_id is computed from either, group_mobility_id is stored for the lists
and the access. The student sends it from the portal card
(POST /my/erasmus/group/<id>/claim, registration._ems_portal_claimable() /
_ems_portal_claim(), the same ems.erasmus.claim._ems_portal_create() as the calls), it gets
the receipt and the answer by email and a task goes to the Erasmus team. An upheld claim is
applied with the manual average or an exception. Only the team, the Head of Studies and the
administrator read claims (claim_ids carries those groups): the leader never does. On the portal, the group card links each published
list (/my/erasmus/group/<id>/resolution/<id>[/pdf], only for students who enrolled) and shows
the student’s provisional result while the claims are open.Withdrawal and substitution: a selected student renounces (portal, or the leader or the team on
their behalf with the enrolment’s Renounce button, action_open_renounce and the
ems.erasmus.group.renounce.wizard, which asks for the reason); their file is withdrawn but every
document is kept. A reserve who does not want a place renounces the same way (action_renounce
accepts reserve), or by themselves from their portal card
(POST /my/erasmus/group/<id>/reserve/renounce, their own enrolment only): they leave the reserve
list and a substitution proposed to them is withdrawn,
so next_reserve moves on to the following one (rejecting the substitution alone would propose
the same reserve again). Rejecting it gives the leader (or the team, with no leader user) a task
to propose a substitute again, since the place is still free. With a
place free, next_reserve shows the first reserve; the leader proposes them
(action_propose_substitution), the coordinator approves or rejects. The frozen ranking is
never rewritten; the history is in the enrolments (substitute_for_id, who proposed and
approved, when) and the chatter.
selected_count/reserve_count count the
result the lists publish (_ems_list_result: approved result, else the coordinator’s exception,
else the proposal), and a banner warns while more students are selected than places (the
approval refuses it anyway). conduct_reviews (team only) counts the enrolled students not
excluded whose frozen strike_count reaches the coexistence threshold
(ems.erasmus.call._ems_conduct_blocked_count, the calls’ art. 6 rule; per row,
conduct_review): a warning, never an exclusion. During the enrolment the team already sees the
Selection tab (who enrolled). ranking_average shows everyone the average the ranking uses
(EMS’s or the manual one); the team may enter a manual average also for a student with grades,
to apply an upheld claim.action_request_exception keeps the coordinators’ new tasks in
exception_activity_ids; sending or returning the proposal closes the mobility’s other tasks
(_ems_activities_done(keep_exceptions=True)), not those: they close when the coordinator writes
result_override on that enrolment, or at the approval.email_cc) of the provisional result and of the group’s
own result email, through ems.erasmus.application._ems_mail(..., family_copy=True), as the
calls do (res.partner._ems_informed_recipients).Group mobilities use the Erasmus+ document engine as it is, without an application and
without a second engine. Two shared models are extended with _inherit in
models/erasmus/group_mobility.py (not edited in their own files, to keep the branch that
reorganises the documents free of conflicts):
| Question | How it is answered |
|---|---|
| Which project does a document belong to? | line.group_mobility_id.project_id (individual lines: line.mobility_id.project_id / the application’s mobility). |
| Which mobility? | ems.erasmus.application.document.group_mobility_id (set on every group line). |
| Which participant (individual document)? | group_participant_id → ems.erasmus.group.participant (partner_id, employee_id, role). |
| Is it a shared document of the mobility? | group_mobility_id set and group_participant_id empty: one line per mobility (e.g. the group learning agreement). Individual files reference it through the mobility; no copy is ever made. |
| Document type and requirement | call_document_id → ems.erasmus.call.document, which for a group belongs to the mobility (group_mobility_id, no call_id) and says who it is for (group_audience: collective, student, teacher, participant), requirement (required, optional, minors), stage, signers (sign_*), handled_by, confidential, file_category (the record’s category), deadline rule. |
| Validation and signature | The same fields and rules as every line (records.md): review_state, review_comment, files (every version kept, never removed from a valid line or a closed group mobility) and the team’s prepared files; the record status file_state (a document someone signs is complete only once the team marks it valid) and file_category. There is no electronic signature workflow (see records.md, “Signatures”). |
| Read and write permissions | Record rules on ems.erasmus.application.document and ems.erasmus.call.document for ems.group_erasmus_group_teacher (below); the review (review_state) only by the team or the leader (write override). Attachments follow the line’s access. |
Constraints: a line has an application or a group mobility (SQL CHECK), and a participant’s
line belongs to the participant’s own mobility; a call document has a call or a group
mobility (SQL CHECK). Every Erasmus+ document is prepared outside EMS: EMS
has no generators or templates, only the upload, the signatures, the review, the states and the
record. The default documents of a new group mobility (_ems_default_requirements, editable on each
mobility) follow SEPIE’s list for KA121-VET group mobilities (Guide 2025 pp. 94-97, Annex 2 pp. 2-3,
checked with adriamt 2026-10-29):
sign_coordinator, sign_host). The planned one before leaving; the executed one on
return (stage return, required): real dates, activities, methodologies and the final list of
participants of every centre, which is why there is no separate list of participants and no
individual learning agreement. If nothing changed it ratifies the planned one.insurance (added to ems.erasmus.call.document.requirement): each
participant’s own policy (students and teachers, group_audience participant) is required
unless ems.erasmus.group.participant.insurance_collective is ticked; the collective
Collective insurance policy becomes required once any active participant is covered
(_compute_is_required). Otherwise it is not_applicable.ems.erasmus.group.participant.auth_image is the student’s
authorisation of the course (res.partner.auth_image), shown in the participants’ list. Lines are
created when the selection is approved (_ems_sync_documents, _ems_sync_collective_documents)
and never duplicated or removed by updating them.The same mechanism as the internship mobilities (ems.erasmus.commitment, portal acceptance with
the logged-in user, date and IP, no other signature system). Each selected student accepts it on
their portal file (/my/erasmus/group/<id>/commitment) and, for a minor, the family on its own
portal page (/my/erasmus/group/commitment/<participant id>, only for a child it acts for,
res.partner._ems_erasmus_guardian_group_participants), in any order, while the mobility is in
preparation. The family is emailed when the file opens
(email_template_erasmus_group_commitment_guardian). The letter is one common template built in
ems.erasmus.group.participant._ems_commitment_letter (whole translatable sentences, in the
reader’s language): authorisation to take part in this mobility with destination, host and dates
once confirmed (otherwise “to be confirmed”), taking part in the programme, the centre’s
coexistence rules and the teachers’ instructions, the measures for a serious breach under the
centre’s rules and protocols, communication and collaboration with the centre, plus the mobility’s
additional conditions (commitment_extra). The text is stored exactly as at the first
acceptance (commitment_signed_text) and that is what the second one accepts. When the
destination, the host, the dates, the travel dates, the teachers or the additional conditions
change afterwards, the acceptance is kept unchanged as an earlier version and both have to accept
the new letter (see “Commitment letter versions” in records.md); an acceptance while
the destination or the start date is still to be confirmed is provisional. Until both are done, and
not provisionally, the participant is not ready to leave (preparation_complete), and the mobility
counts the pending ones (commitments_pending). The
letter says it does not replace the official authorisation to travel abroad, which stays a
document of the file. Teachers sign no letter.
Actions > Export participants (Excel) (Erasmus team only) downloads, from
/ems/erasmus/group/participants, the same workbook as the calls
(ems.erasmus.application._ems_participants_workbook, sheet and PARTICIPANT_HEADERS
unchanged) with the active participants: the selected students first, then the accompanying
teachers. Students’ rows come from their contact (_ems_student_row) and teachers’ from their
employee file (_ems_staff_row), the same as in the calls. Teachers are told apart without a new
column: their cycle, year and legal guardian columns are empty. The bank columns stay empty for
everyone (a group mobility pays collectively, nothing is transferred to a participant). Built on
the fly, never stored.
Deadlines count from the group mobility: destination = the day the selection was approved
(destination_date), before_start / after_end = its final dates.
Group mobilities are part of the Erasmus+ document records (records.md):
file_category on each
requirement: health card, inclusion and minors’ authorisation in 01, the group’s travel documents
and common evidence in 03, the rest by stage), the same file_state and the same history rules.
The health card is confidential, as in the calls: only the Erasmus team sees it.GRUP<id>_<name>/: the common documents once, the selection’s evidence, the follow-up, the EU
Survey and each active participant’s record), and a group mobility can be exported on its own.ems.erasmus.group.registration and the
mobility’s chatter, never in a participant’s travel file; in the ZIP it is the group’s
Selection.csv and Draws.csv, with the conduct and fewer-opportunities data only in an audit
export.action_start_stay,
action_end_stay). On return EMS schedules the EU Survey task for its responsible person
(eu_survey_user_id, by default the leader) with a deadline (30 days if empty). That person or
the leader says it is answered, with evidence if any; the team validates it. EMS does not
connect to the EU Survey platform. In group mobilities only the leader answers the EU Survey
(decided by the coordinator, 2026-10-24): students and the other teacher have no survey task.
The state and deadline come from the mixin ems.erasmus.eu.survey, shared with the individual
mobilities (audit D-8, see erasmus.md), which also provides _ems_schedule().ems.erasmus.group.log). Tasks and reminders are Odoo activities on the mobility, which reach
the daily task digest.programme_execution (as_planned / changed, with programme_changes required when changed,
both tracked). action_propose_closure and action_close refuse without it
(_ems_check_programme_answered). The executed group learning agreement records the result.ems.erasmus.invoice records (Services paid by the centre) linked to the group
mobility (group_mobility_id, covers = 'group', issue #791), charged to its project and never split into provisions:
they lower each participant’s pocket money (invoice_share).Erasmus+ > Mobilities > Group mobilities: kanban by state and list, with the groups, leader, destination, enrolled and selected students, documents missing and to review, a tie to resolve, the EU Survey state and the late tasks (Odoo activities). Each card opens the mobility’s panel.
action_view_participant_documents):
every active participant’s lines on one editable list grouped by document
(view_erasmus_group_participant_document_list), to upload each grant agreement or review without
opening each file. The record rules decide what each one sees (the leader, no confidential line).required_signers (on the line): the signatures this participant’s line requires
(signature_ids.is_required), shown instead of the document type’s signers in the group lists.not_ready lists the active participants not preparation_complete; the form shows it in
preparation, and The stay starts asks for confirmation.ems.erasmus.group.log.attachment_ids) and the EU Survey evidence are tied to
their record (ir.attachment._ems_link_to) on create/write: uploaded from the form they had no
res_id, so only the uploader could read them and the others got an access error./my/erasmus?satisfaction_answered=1 opens even with nothing else to show.The leader and accompanying teachers get the hidden group ems.group_erasmus_group_teacher,
managed by EMS when the mobility’s teachers change (res.users._ems_sync_erasmus_group_teacher_group),
which shows Erasmus+ > My participation > My group mobilities. Record rules restrict them to their own mobilities;
what each role may change is checked again in the models (EmsErasmusGroupMobility._ems_role,
write overrides), never only by hiding buttons.
| Erasmus coordinator | Mobility technician (Erasmus team) | Leader teacher | Accompanying teacher | Head of Studies | Student (portal) | |
|---|---|---|---|---|---|---|
| Group mobilities | all, create and change | all, create and change | own: read; programme, notes, shared documents, follow-up, EU Survey evidence | own: read; follow-up | all, read | the ones they can enrol in or take part in |
| Enrolments and ranking | all | all | own mobility: rank, average, eligible (no conduct data) | no | all, read (no conduct data) | own enrolment and result |
| Open / close enrolment | yes | yes | no | no | no | - |
| Publish the provisional list | yes | no | no | no | no | - |
| Published lists | all | all | no | no | all, read | lists of the mobilities they enrolled in, own result |
| Send the proposal | yes | yes | yes | no | no | - |
| Approve, send back, exceptions, substitutions | yes | no | request only | no | no | - |
| Record a renouncement (selected or reserve) | yes | yes | yes | no | no | own place (portal) |
| Draws | all | all | own mobility, without the fewer-opportunities flag | no | all, without that flag | no |
| Participants’ files | all | all | own mobility, not confidential | own mobility (read), own documents | all, not confidential | own file |
| Review documents | yes | yes | own mobility | no | no | - |
| Follow-up | all | all | own mobility | own mobility | read | no |
| EU Survey | validate | validate | answer | no | no | - |
| Close / cancel | yes | yes | propose closure | no | no | - |