EMS

Erasmus+ calls and applications

Issues #682 (umbrella), #683 (phase 1: calls and applications), #684 (phase 2: scoring and interviews), #685 (phase 3: resolutions, claims and place offers), #686 (phase 4: the staff call) and #687 (phase 5: mobility preparation). Design of the whole project: plans/erasmus_portal.md. This page describes what is implemented. Group mobilities (KA121-VET, issues #701-#704) are in group_mobility.md.

The centre publishes a yearly Erasmus+ call for its vocational training students (CFGM/CFGS, any year). Students apply from the portal (/my/erasmus), upload the documents the call asks for and follow their application; the Erasmus team checks the requirements and the documents, asks for corrections (subsanation) and admits or excludes each application, then scores the admitted ones (record average, interview, languages, fewer opportunities, first mobility, conduct warnings) and ranks them per modality. The resolutions, approved by the Erasmus coordinator, are published on the portal, claims are recorded, and the places are offered to the selected and, when one is renounced, to the next reserve. The centre’s vocational training staff apply to their own call from the backend (see “Staff in the backend”); a panel rates their mobility plans (see “Staff call”). Once a place is accepted, the mobility is prepared in EMS: destination, host entity, documents and checklist (see “Mobility preparation” at the end).

Models

erDiagram
    ems_erasmus_call ||--o{ ems_erasmus_call_modality : "modality_ids"
    ems_erasmus_call ||--o{ ems_erasmus_call_project : "project_place_ids (staff)"
    ems_erasmus_call_project }o--|| ems_erasmus_project : "project_id"
    ems_erasmus_call ||--o{ ems_erasmus_call_document : "document_ids"
    ems_erasmus_call ||--o{ ems_erasmus_application : "application_ids"
    ems_erasmus_call_modality }o--o{ ems_level : "level_ids"
    ems_erasmus_application }o--|| res_partner : "partner_id (student)"
    ems_erasmus_application }o--|| ems_erasmus_call_modality : "modality_id"
    ems_erasmus_application ||--o{ ems_erasmus_application_document : "document_ids"
    ems_erasmus_application_document }o--|| ems_erasmus_call_document : "call_document_id"
    ems_erasmus_application_document }o--o{ ir_attachment : "attachment_ids (every version)"
Model Purpose
ems.erasmus.call One call: who applies (audience: students or staff), course, dates (date_open, date_close, optional subsanation_deadline), the published call PDF, the text shown on the portal, state.
ems.erasmus.call.modality A selection list with its own places (GM, GS): places, the levels whose students compete in it, and the project kind (KA121-VET / KA131-HED), computed from the levels (issue #767: CFGS and EFPS on KA131-HED, any other level on KA121-VET; stored). Students’ calls only (issue #772). The real destinations are ems.erasmus.destination lines.
ems.erasmus.call.project Issue #772: a staff call’s places paid by one project (project_id, places, unique per call; assigned_count: the call’s non-cancelled mobilities on it, one _read_group). Field project_place_ids of the call, groups Erasmus team and admin, ACL for those two only: the rest read the total through _ems_places() (sudo). Not copied with the call (each year has its projects).
ems.erasmus.call.document A document the call asks for: required, optional or required for minors; confidential (only the Erasmus team sees it).
ems.erasmus.application One student’s application to one call (unique per call and student).
ems.erasmus.application.document The files uploaded for one document of the call, with the team’s review.

The modalities and documents are copied when a call is duplicated, so next year’s call starts from this year’s.

Who can apply is decided by the modalities, not by code: a student can apply when the level of their main group is in one of the call’s modalities, and that modality is the application’s. Any year of the cycle.

Call states

stateDiagram-v2
    [*] --> draft
    draft --> published: Publish (needs a modality and a required document)
    published --> draft: Back to draft (no application submitted yet)
    published --> closed: Close applications
    closed --> [*]

A published call is shown on the portal to every student who can apply to it. Applications are accepted only while it is published and the company’s local time is between date_open and date_close (is_accepting, computed with ems.datetime_utils, never the browser’s clock). Closing turns every application still in draft into Not submitted.

Phase (issue #785). state only says whether applications are taken; the form’s status bar and the call list show phase, a stored compute on state, the published resolutions and the offers’ state: Draft and Published as the state; once closed, Scoring until the provisional resolution is published (the admission list is still part of it), Resolution until the definitive, then Offers while an offer waits for an answer and Places assigned (key finished) when none does: the students may still be choosing their destination, so it doesn’t say “Finished” (C23, 2026-11-13). A place offered to a reserve later moves it back to Offers. Business rules keep reading state.

Deadlines from the closing date (issue #767)

The four deadlines after closing are filled in by EMS from date_close (_ems_deadlines(), the same for students’ and staff calls): that many days after the closing day (DEADLINE_DAYS: corrections 7, interview/evaluation 14, claims 19, acceptance 25), at 14:00 in the centre (DEADLINE_HOUR), moved to the next school day when that day is a weekend, a public holiday or a school break (resource.calendar.leaves._ems_nth_school_days(), shared with the ex officio withdrawal circuit, which reads the holidays once for the four deadlines). create() fills the ones not given; write() and the onchange of date_close move the ones still empty or equal to what the old closing date gave (_ems_following_deadlines()), so a deadline changed by hand stays. A new, unsaved call has no earlier closing date to compare with: in the form, all four follow every closing date set.

date_order_warning (non-stored) lists the dates out of the process order (PROCESS_DATES: open, close, then the four deadlines), each against the first earlier step that comes after it. The form shows it as a warning above the settings; saving is not refused, since a deadline is sometimes moved on purpose (e.g. the claims one brought forward once every claim is answered).

reminder_days is 3 by default; it is not in the call’s form, only in the notice wizard.

Notice of the open call and reminder before closing

Publishing tells nobody. action_announce opens the ems.erasmus.call.announce wizard (Erasmus team only), which counts the recipients and calls _ems_send_announce(); the hourly cron ir_cron_erasmus_remind_closing (_cron_remind_closing()) sends the reminder. Both go through _ems_announce(), which tells each recipient the way their audience is reached (issue #802):

  Notice Reminder
Triggered by the Erasmus team, from the call (any number of times) the cron, once per call (reminder_date)
When while published and not closed (before date_open too) from reminder_days days before the closing day (local), from 9:00 (REMINDER_HOUR), while is_accepting, and only if announce_date is set
To _ems_eligible_partners() the same, minus the partners with an application not in draft
Students’ call email_template_erasmus_call_open, to the school address email_template_erasmus_call_reminder, to the school address
Staff call an ems.info_notice on the call, for the daily summary the same
Recorded in announce_date, announce_count, chatter reminder_date, reminder_count, chatter

_ems_eligible_partners() mirrors the portal’s rule (res.partner._ems_erasmus_calls()) in the other direction, for the whole centre in a few queries: students whose main group is of a modality’s level (conduct warnings rule nobody out); staff, the internal users of the teachers of staff_level_ids plus validator_ids.

Every notice and reminder sent is also recorded as a diffusion action (quality.py, channel “Email from EMS”, which covers the daily summary too).

Application states

stateDiagram-v2
    [*] --> draft: first save on the portal
    draft --> submitted: Submit (every required document uploaded)
    submitted --> submitted: edit and submit again (until date_close)
    draft --> not_submitted: call closed
    submitted --> subsanation: Request corrections (team)
    subsanation --> submitted: applicant uploads and submits again
    submitted --> admitted: Admit (team)
    submitted --> excluded: Exclude (team, with a reason)
    subsanation --> excluded: Exclude
    admitted --> submitted: Back to review
    excluded --> submitted: Back to review

Documents

Every upload adds an attachment to the document line; earlier files are never removed, so every version stays. A new upload puts the line back to Pending review. The team marks each line Valid or Needs changes (with a comment the applicant sees on the portal).

Viewing files, confidential ones view only (issue #845)

Every file field of the Erasmus+ views uses the ems_attachments widget (eye: Odoo’s file viewer; download; remove while editable). Odoo’s stock many2many_binary is no longer used in views/erasmus/. The call’s Bases PDF is a single Binary field with its own pencil, download and bin, not a many2many, and is left as it is.

A document whose own confidential field is set (ems.erasmus.application.document and ems.erasmus.project.document; the view must carry that field, as column_invisible) is view only:

Admission checks

Requirements (enrolled in a modality’s level, no previous Erasmus+ internship in this cycle, family authorization if minor): recorded by the Erasmus team, with result (Pending, Met, Not met), author and date stamped by write().

Conduct (students’ call, art. 6), never recorded by hand: EMS has no register of disciplinary sanctions, only the conduct warnings (ems.strike), and the coexistence team reviews a case each time a student reaches res.company.strike_escalation_threshold warnings (3 by default). That number rules nobody out (adriamt, 2026-11-03): art. 6 says the Erasmus team may exclude, with a reason and having heard the teaching team and the coexistence team, a student with disciplinary records or serious coexistence incidents this course. EMS only points them out: call._ems_course_strike_count(partner) counts their warnings since 1 September of the call’s course (ems.course.date_range(), centre’s timezone), shown on the application as course_strike_count and conduct_review (non-stored, true at the threshold or above, via _ems_conduct_blocked_count(); a threshold of 0 disables it; staff calls never). The form warns the team at the top while the application is under review, and Exclude (with its reason) does the rest. Criterion F, the scoring’s penalty per warning, still applies to whoever goes on. Group mobilities follow the same rule (the coordinator’s exclusion is a result exception there).

Application documents (the 2026-11-03 review). Each call document says how it is handed in (upload_kind): files, PDF only (_ems_add_files refuses a file not named .pdf or not starting with %PDF: the CV sent to companies) or a link (the presentation video on Google Drive: _ems_add_link keeps it as an ir.attachment of type url, so the line’s file state, the review and the submit check treat it like a file; the dossier ZIP writes it as an Internet shortcut, .url). help_url is shown with the instructions (the Europass editor). The requirement fewer_opportunities makes a line required only when the applicant declares fewer opportunities (is_required); the portal renders those documents under the fewer opportunities box and hides them with CSS until it is ticked (:has(), no script). The portal form puts the documents first, then fewer opportunities, then the notes; there is no availability question (the dates are in the rules).

The Head of Studies and the Director read the applications; they write nothing on them.

Tasks and notices to the staff

Staff (the Erasmus team, evaluators, the panel, validators, the Secretary, tutors) never get an Erasmus+ email on the spot: nothing in the process is urgent (agreed 2026-11-05). Every to-do is an activity scheduled with mail_activity_quick_update (no “assigned to you” email) and reaches its owner in the daily summary; a notice that asks for nothing (the tutor’s “your student accepted a place”, the evaluators’ list of interviews) is an ems.info_notice for that same summary (see daily_summary.md). Students and families keep their emails.

Portal (controllers/portal_erasmus.py)

The call’s Information for applicants (description, shown above the form) and the group mobility’s Information for students use the ems_html_codeview widget (static/src/js/backend/html_codeview_field.js, issue #774): Odoo’s own html field with its code view (</>) in a fixed toolbar, so the Erasmus team can paste a card prepared elsewhere with the Bootstrap classes the portal already ships. Pasting rendered HTML into the editor drops the classes; the code view keeps them, and the field’s default sanitizing keeps class (not style). Odoo’s own codeview option only shows the button in developer mode, which is why the widget turns it on itself; the fixed toolbar is EmsHtmlBlockField’s, the minutes’ one.

Route What
GET /my/erasmus The person’s own applications, the calls open to them now, and the others folded.
GET /my/erasmus/call/<id> The application form for that call.
POST /my/erasmus/call/<id>/save Save answers and uploads; with submit, submit too.
GET /my/erasmus/call/<id>/rules Download the call PDF.

The applicant is always request.env.user.partner_id: no partner or application id travels in a form. The controller works with sudo() (portal users have no ACL on these models) and checks eligibility and state itself. A refused action (a UserError) goes back to the page with ?error=1 and its own message, kept in the session for that one redirect (_ems_error_redirect/_ems_error_message): “Upload the required documents first: ", not a generic "it could not be saved". When one form sends several documents, the valid ones are kept and the refused ones are listed together (`_ems_portal_save`), so a CV that is not a PDF never loses the video link pasted with it. Each file shows its date; the earlier versions of a `single_file` document are marked *Earlier version*. While the application is a draft (`state == 'draft'`), `/my/erasmus/call//file//remove` deletes a file uploaded by mistake (`_ems_portal_remove_file`, nobody has reviewed it yet); once submitted, only the team removes one, with a reason (*Remove a file*). A call document's `template_file` (*Model to download*) is served by `/my/erasmus/call//template/`, to the applicant and to the family of a minor applicant. The portal home card appears only to students who have an application or can apply to a published call (`res.partner._ems_erasmus_portal_visible`), and to the family of a minor applicant, which follows the application read only from the start (`_ems_erasmus_guardian_applications()`: state, the non-confidential documents that apply and their models). The portal's top menu has an *Erasmus+* entry under the same rule (`views/portal/portal_header.xml`, like *Convalidations*), so a student who cannot apply (PFI, CFGB) sees neither.

The page lists the person’s own applications first (My applications), then the calls they can apply to now (Open calls), and folds the rest (not open yet, or closed) under Other calls. Each application, on that page and on its own, shows a step bar and a “what to do now” box, both from ems.erasmus.application._ems_portal_progress(): eight steps (application, document check, interview or plan rating, resolution, place, preparation, stay, return), each done, current, todo or failed (where an excluded, not submitted, not selected or renounced application ended), and the next action with its deadline and colour (warning when the person has something to do). On a phone (below Bootstrap’s sm breakpoint) the bar is hidden and its position is shown instead, “Step N of 8” and the step’s name (issue #785: eight steps broke into two lines). The state badge is coloured by PORTAL_STATE_BADGES. The corrections asked for and the interview are in that box (its class keeps o_ems_erasmus_subsanation / o_ems_erasmus_interview). Once the application can no longer change, the call’s text and the form fold under The call and my application; of the published results, the newest is open and the earlier ones folded. A defined mobility (preparing or closed) is split into tabs (Summary, My record, Steps, During the stay, On return), opened on the one with something to do.

The form never asks whether the student took part in Erasmus+ before: First mobility (criterion E) is the Erasmus team’s, checked against the person’s history below.

Access control

New group ems.group_erasmus (“Erasmus+ / Manager”), assigned through the roles Erasmus coordinator (ems.role_erasmus) and Erasmus mobility technician (ems.role_erasmus_technician). The coordinator’s role gives ems.group_erasmus_coordinator (“Erasmus+ / Coordinator”, implies Manager), the only one besides ems.group_academic_admin that can publish a resolution (#686: the coordinator alone approves them). The administrator is a member of both.

Model Erasmus team Head of Studies / Director Portal
ems.erasmus.call, .modality, .document rwcu r via controller (sudo)
ems.erasmus.application rwcu r via controller
ems.erasmus.application.document rwcu r, not confidential ones (ir.rule) via controller

Menu Erasmus+, in sections like the rest of EMS, each shown only to whoever sees one of its entries:

Section Entries
Calls Calls, Applications, Ranking, Resolutions, Claims, Place offers (the order of the process, issue #789)
Mobilities Pending validation, Individual mobilities, Group mobilities
Projects An entry of its own, no submenu (action_erasmus_project: the economic list, its pivot and the form; issue #789)
Financial management Grant payments, Services paid by the centre, Project expenses
Quality Indicators, Satisfaction surveys, Low scores, Diffusion actions
My participation Interviews to score, Plans to rate, My group mobilities, Staff calls, My applications, My mobilities
Configuration Host entities, Organisational support rates, Earlier course indicators

Every teacher has the app (right below Meetings), at least for My participation > My application, which opens their portal page /my/erasmus (an ir.actions.act_url): that is where staff apply to the staff call and follow their mobility, the Erasmus+ team included. Opening the app runs its first entry, so My participation goes after the management sections (the team lands on the calls) and My application last in it (an interviewer or a panel member lands on their own scoring, a teacher with nothing else on their portal page). The personal entries other than My application only show to whoever has something there. Each one has its own hidden group, managed by EMS (res.users._ems_sync_erasmus_evaluator_group, _ems_sync_erasmus_group_teacher_group), so nobody sees an entry with nothing in it: an interviewer is in ems.group_erasmus_evaluator, a panel member with plans to rate in ems.group_erasmus_panel.

The call’s form opens each step of its own process with a stat button (ems.erasmus.call. _ems_call_action, an action narrowed to the call): Applications, Ranking, Interviews (students) or Plan ratings (staff), Resolutions, Claims, Place offers and Mobilities. Interviews and Plan ratings have no menu entry: they are only reached from their call.

session_info (models/erasmus/ir_http.py) gives a member of the Erasmus team who is not a teacher the calls (action_erasmus_call) as home when theirs is still the roll call every new account copies from base.default_user, which they cannot open (_ems_erasmus_home_action); a home chosen on purpose is kept.

A new call shows its defaults before it is saved: default_get() and the audience onchange (on an unsaved call) fill them from _ems_audience_defaults(), the same dict create() uses for whatever is still empty. The onchange assigns each list as new records, not as commands: document_ids and preparation_document_ids are lines of the same model, and replacing one with commands brought back lines of the other.

Default texts in every language (issue #780). The texts a new call starts with are translatable fields (translate=True): the modality’s name, the call document’s and checklist step’s name and description, the self-assessment question’s name and the call’s commitment_text; a group mobility’s tie_break and its documents (requirement_ids) too. Odoo stores a new text only in the creator’s language, so after create() (and after a write() that adds lines from the form, e.g. on changing audience) models/erasmus/default_data.py rebuilds the defaults once per installed language and gives every line still holding a default (matched by name, then instructions) that default’s translations (update_field_translations). A line renamed in the form before saving is not matched and keeps what was written, with Odoo’s usual fallback. A copy keeps the translations (Odoo’s copy_translations). Calls created before keep their texts: the upgrade only turns the columns into translatable ones, with the old value as the source. The trade-off: changing a default text later in one language leaves the others as they were (the form’s language button edits them). A staff call has no modalities (issue #772). A staff call has no preparation step (teachers have no preparation sessions, and the activities left for their groups go on Moodle, outside EMS), and Share it at a department or cycles meeting is requirement='optional' (art. 15): an optional step (TASK_REQUIREMENTS) is listed (on the portal with “(optional)”) but never counts towards preparation_complete/return_complete (is_required False).

Subjects of the to-dos built with a name go through ems.base.ems_elide(), which elides “de” in Catalan (“d’Anna”).

Staff in the backend

Since the 2026-11-04 review the portal is for students and families only: a staff member applies to a staff call, follows their application and prepares their mobility in the Erasmus+ app, under My participation (views/erasmus/staff/views.xml, models/erasmus/staff_backend.py, models/erasmus/staff_wizards.py):

Menu Action Model and domain
Staff calls action_erasmus_staff_calls ems.erasmus.call, staff_mine (non-stored, searchable: the staff calls the user can apply to or has applied to)
My applications action_erasmus_my_applications ems.erasmus.application, the user’s own staff applications
My mobilities action_erasmus_my_mobilities ems.erasmus.mobility, the user’s own staff mobilities

Workflow fields and evidence (audit 2026-10-25)

models/erasmus/workflow.py holds what every Erasmus+ model applies on top of the table above:

Scoring (phase 2, #684)

Art. 12 of the call: up to 100 points, 50 to be eligible (ems.erasmus.call.min_score).

  Criterion Field(s) on the application Who / how
A Record average x 4 (max 40) grade_average, grade_line_ids Computed by EMS at closing (below). Never typed by hand.
B Interview: general (max 20) + English (max 15) interview_general, interview_english Mean of the submitted interviews (below).
C Language certificate (B1 2.5, B2 5, C1 7.5, C2 10) language_level Erasmus team.
D Fewer opportunities (10 or 0) fewer_opportunities_check Erasmus team only (confidential).
E First mobility (5 or 0) first_mobility Erasmus team.
F -3 per conduct warning, max -9 strike_ids, strike_count Frozen at closing (below).

score_total = A + B + C + D + E + F, with no floor at zero. Every manual criterion starts empty (pending) and stores who set it and when (<field>_user_id, <field>_date, stamped by write()). A pending criterion is never zero: score_complete stays false and the application is left out of the ranking.

Frozen at closing

Close applications (ems.erasmus.call.action_close) freezes, for every application that was submitted (states submitted, corrections requested, admitted, excluded), the data the score is based on (_ems_freeze_scoring_data, sets scoring_frozen_date). Later changes in grades or warnings never change it.

Record average (A) - _ems_grade_lines(), every module of the applicant’s current cycle (the study of their main group), every year of it:

There is no manual average (decided 2026-10-22: no certificate of previous studies): a student new to the centre is scored with this course’s provisional grades. With no evaluated module at all, A stays pending (score_a_pending) and the application has no complete score.

Conduct warnings (F) - the applicant’s ems.strike records up to date_close whose group belongs to the same study (group_id.study_id), copied to strike_ids/strike_count. EMS only holds warnings since the course it started recording them.

Ranking

Per modality, among admitted applications (rank, stored, recomputed when any application of the call changes). The ranking of a modality is only computed when every admitted application in it has a complete score; until then every rank in it is 0. Order: total, then the tie-breaks of art. 12 - fewer opportunities, first mobility, English part of the interview, record average - and finally the draw (draw_order, lower first). Applications still tied after all of it share the rank and get needs_draw (the call’s needs_draw says some has it). A tied set keeps needing a draw until each of its applications has its own drawn position: when a correction (a claim upheld) ties someone with a set already drawn, the newcomer’s draw_order 0 would otherwise put them first with no draw, so the whole set is flagged again. is_eligible: complete and total at least min_score.

Draw (audit D-13): draw_order is read only; the Erasmus coordinator (or the administrator) runs Actions > Draw the ties on the call (action_draw_ties): before the provisional resolution, which needs every tie drawn, and again whenever a correction ties someone (also after the definitive resolution, before a rectification; otherwise a tie created by a correction could never be published). EMS orders each tied set (per modality; a staff call’s, of the whole list; every member, those drawn before included) at random with secrets.SystemRandom, writes draw_order and keeps the draw as an immutable ems.erasmus.group.draw (the same model as the group mobilities’, with call_id instead of group_mobility_id and score_total as what they were tied on; its lines point at the application_id), listed in the call’s Resolutions tab and summed up in its chatter (EmsErasmusGroupDraw._ems_run, shared with the group mobilities). The teachers of a group mobility only read the group draws (rule_erasmus_draw_group_teacher).

Interviews (phase 2, #684)

erDiagram
    ems_erasmus_application ||--o{ ems_erasmus_interview : "interview_ids"
    ems_erasmus_interview }o--|| res_users : "evaluator_id"
    ems_erasmus_application ||--o{ ems_erasmus_application_grade : "grade_line_ids (frozen)"
    ems_erasmus_application }o--o{ ems_strike : "strike_ids (frozen)"

ems.erasmus.interview and the staff’s ems.erasmus.plan_rating (phase 4) share the evaluator’s workflow through the abstract model ems.erasmus.evaluation (models/erasmus/evaluation.py): evaluator, state, submit, reopen, lock at the review deadline or the provisional resolution, the evaluator’s activity, the evaluator group membership (ems.group_erasmus_evaluator for an interview, ems.group_erasmus_panel for a plan rating) and the write guard (an evaluator writes only the rubric _ems_criteria and their notes). Each model only adds its rubric.

The Erasmus team sets the interview’s date and place on the application (interview_date, interview_place) and assigns two evaluators (ems.erasmus.interview, one per evaluator, any internal user). Send interview call emails the applicant the date and place (email_template_erasmus_interview_call), at least 24 hours ahead (art. 11).

Each evaluator scores annex 4’s rubric, 0-5 per criterion, all required to submit:

Part Criteria Field
General (max 20) motivation, maturity and autonomy, handling difficulties, adaptation and communication general_score
English (max 15) comprehension, fluency and interaction, accuracy, vocabulary and pronunciation english_score
stateDiagram-v2
    [*] --> draft: assigned (activity for the evaluator)
    draft --> submitted: Submit (every criterion scored)
    submitted --> draft: Reopen (evaluator until the call's interview_deadline; team any time)

Access (phase 2)

  Erasmus team Head of Studies / Director Evaluator
Criteria C, E, draw W R -
Criterion D W - -
ems.erasmus.interview rwcu - rw own (rubric, notes), no create/unlink
ems.erasmus.application.grade r r -

Resolutions, claims and place offers (phase 3, #685)

erDiagram
    ems_erasmus_call ||--o{ ems_erasmus_resolution : "resolution_ids"
    ems_erasmus_resolution ||--o{ ems_erasmus_resolution_line : "line_ids (frozen)"
    ems_erasmus_resolution_line }o--|| ems_erasmus_application : "application_id"
    ems_erasmus_application ||--o{ ems_erasmus_offer : "offer_ids"
    ems_erasmus_application ||--o{ ems_erasmus_claim : "claim_ids"
    ems_erasmus_claim }o--o| ems_erasmus_resolution : "resolution_id (against)"
Model Purpose
ems.erasmus.resolution A list the Erasmus team prepares and the Erasmus coordinator approves by publishing it: admission, provisional, definitive or rectification.
ems.erasmus.resolution.line One applicant in it, frozen when the resolution was prepared: modality, rank, every criterion, total, result, masked identity document. Described as “Erasmus+ result” and named “ - ", which is what the email layout's header shows.
ems.erasmus.offer A place offered to an applicant and their answer.
ems.erasmus.offer.wizard Offer a free place to the next reserve (transient).
ems.erasmus.claim A claim (after the provisional) or an appeal before the Head of Studies (after the definitive).

New fields on the call: claims_deadline (shown to applicants with the provisional result) and acceptance_deadline (the deadline of the offers made when the definitive resolution is published). New application states: selected, reserve, not_selected, accepted, renounced; the ranking (_compute_rank) counts every one of them as admitted (RANKED_STATES), so publishing results never changes a rank.

Resolutions

stateDiagram-v2
    [*] --> draft
    draft --> draft: Prepare lines (freezes them, repeatable)
    draft --> published: Publish (Commission approval recorded)
    published --> [*]

Order, each one needing the previous one published (PREVIOUS_KIND): admission, provisional, definitive, then any number of rectifications. Admission, provisional and definitive are published once per call (SINGLE_KINDS).

Preparing (action_prepare, checked again on publishing) needs the call closed, every application admitted or excluded, and - except for the admission list - every admitted one with a complete score and no pending draw (A missing value blocks, never zero). It also needs every applicant’s identity document (document_id, or passport_id). The lines copy, for the admission list, the admitted and the excluded; for the others, also every result (RANKED_STATES), with the rank, the criteria and the result. The definitive resolution also waits for the claims (art. 14): it is refused while the call’s claims_deadline has not passed or any claim of the call is still open.

Result Rule (_ems_ranking_result)
excluded The application is excluded; the reason goes on the line, only for the applicant.
not_selected Not eligible: below the call’s minimum score.
selected Eligible and rank within the modality’s places.
reserve Eligible, after the places.

Publishing is the coordinator’s approval (ems.group_erasmus_coordinator or ems.group_academic_admin, checked in action_publish(); who and when are published_by_id and publish_date, shown on the list as the approval date). It needs the lines, notes for a rectification and, for a definitive resolution or a rectification, a future acceptance_deadline. Then:

Published lists never show names. The portal list (/my/erasmus/call/<id>/resolution/<id>) and the PDF for the centre’s website (ems.action_report_erasmus_resolution, printed from the resolution form’s Actions > Print the published list (action_print, this record only) and from the list’s Print menu (bound to the list only, issue #786), same template ems.erasmus_resolution_list) show, per modality, the rank, the masked identity document (public_id), the total and the result. mask_document_id() follows the Spanish data protection agency’s guidance for additional provision 7 of Organic Law 3/2018: DNI ***4567**, NIE ****4567*, any other document its 4th to 7th characters.

Place offers

stateDiagram-v2
    [*] --> pending: definitive published (selected) / wizard (reserve)
    pending --> accepted: applicant accepts on the portal
    pending --> renounced: applicant renounces on the portal
    pending --> expired: deadline passed (cron)
    pending --> cancelled: team withdraws it

The form’s status bar shows Waiting for an answer, Place accepted, Renounced and No answer (issue #785); a withdrawn offer shows its state only when it is the current one.

Claims and appeals

A log (art. 14): application, the published resolution it is against, kind (claim, appeal before the Head of Studies), received date, text, files, response. The applicant sends a claim from the portal while the newest published provisional resolution is claimable (ems.erasmus.application._ems_portal_claimable: before the call’s claims deadline); _ems_portal_claim creates it with its files and gives every member of the Erasmus team a to-do (ems.erasmus.claim._ems_ask_answer). A claim or an appeal that arrives by email is recorded by the team. Creating one emails the applicant a receipt with the moment it arrived (email_template_erasmus_claim_received); Resolve needs the response and the outcome (Upheld, Partially upheld, Dismissed, issue #792), stamps the date, closes the to-dos and emails both (email_template_erasmus_claim_resolved); the portal shows the outcome under the claim. Whoever answers an appeal writes only response and outcome (ANSWER_FIELDS). Upholding a claim means correcting the application’s data and publishing the next resolution (the definitive, or a rectification).

Appeals follow the hierarchy, not the role. An appeal is answered by _ems_appeal_approvers(): the Head or Deputy Head of Studies found by hr.employee.find_head_of_studies() from the student’s group tutor (main_group_id.tutor_id), or from the teacher themself in a staff call; the Director when the applicant is that Head of Studies or none is found; the administrators when the applicant is the Director. Creating an appeal (or changing a claim’s kind to appeal) gives them the to-do instead of the team. can_resolve (non-stored, depends_context('uid')) shows Resolve/Reopen and makes the response editable, and _ems_check_can_resolve() re-checks it server-side: the team answers the claims, the resolved approvers the appeals, the administrator any of them. ems.group_head_of_studies has write access on the model only for that: write() lets anyone outside the team change nothing but response, and only where can_resolve holds (another Head of Studies cannot). can_edit makes the rest of the form read-only for them.

Export to spreadsheet

Actions > Export to spreadsheet (the applications list, and the Actions dropdown of an accepted application and of the call once its definitive resolution is published) downloads an .xlsx with one row per applicant who accepted a place. An external tool imports it as is, so the sheet (Participantes) and the headers are fixed Spanish strings, in this order, never translated (PARTICIPANT_HEADERS):

Column Source
Nombre, Apellidos firstname, lastname
DNI document_id, else passport_id
Email, Teléfono, Dirección personal email, phone (else mobile), the postal address on one line
Fecha de nacimiento birth_date, as a real date cell (dd/mm/yyyy)
Nacionalidad citizenship_id
Género always empty: EMS keeps no gender for students
Ciclo formativo, Curso the main group’s study acronym and year (1 or 2)
Titular de la cuenta, Banco, BIC, IBAN the first res.partner.bank (holder, else the student’s name), IBAN without spaces
Tutor legal, Email del tutor legal, Teléfono del tutor legal only for minors: every family contact (_ems_family_contacts()), joined with “, “ in the same order in the three columns

It carries personal and bank data: the file is built on the fly by /ems/erasmus/participants (controllers/erasmus_export.py) and never stored, and only ems.group_erasmus can get it (_ems_participants() refuses anyone else; the server action has that group only). Each download is logged (audit D-10, ems.erasmus.export._ems_log_spreadsheet): an export line with scope = participants, the call (or group mobility), who, when and how many people, and a message in the call’s (or group mobility’s) chatter. Who can download it does not change.

Portal (phase 3)

Route What
GET /my/erasmus/call/<id> Adds the place offer (accept / renounce) and a Results card: one entry per published resolution, with the applicant’s own result, rank, total and every criterion.
GET /my/erasmus/call/<id>/resolution/<id> The published list, without names. Only for applicants of that call, only published resolutions.
GET /my/erasmus/call/<id>/resolution/<id>/pdf The same list as a PDF.
POST /my/erasmus/call/<id>/offer Answer the logged-in user’s own pending offer of that call.
POST /my/erasmus/call/<id>/claim The logged-in applicant’s claim against the provisional resolution (text and claim_files).

The list page passes my_partner, so the shared list template (ems.erasmus_resolution_list) highlights the applicant’s own row; the PDF has no my_partner and highlights nothing. A reserve’s result says their place on the reserve list of the modality (ems.erasmus.resolution.line._ems_reserve_number), and while the application is Admitted the top badge shows the newest provisional result. A student’s image_consent is not a form answer: it is copied from their image rights authorisation of the course (res.partner.auth_image) on every save.

Access (phase 3)

Model Erasmus team Head of Studies / Director Portal
ems.erasmus.resolution rwcu (published: read only); publishing: coordinator only r via controller (sudo), published only
ems.erasmus.resolution.line r (written by Prepare lines only); criterion D hidden from others r own lines and the list
ems.erasmus.offer r + Withdraw offer; created by publishing and the wizard r answers their own
ems.erasmus.claim rwcu r -

Menus Erasmus+ > Calls > Resolutions, Place offers and Claims: team, Head of Studies, Director.

Staff call (phase 4, #686)

A call’s audience (Applicants) is student or staff; it cannot change once the call has applications. The engine is the same (call, application, documents, resolutions, offers, claims); what differs:

  Students Staff
Who sees the call on the portal A student whose main group’s level is in a modality An internal user with an employee file (res.partner._ems_erasmus_employee)
Modality Computed from the level when applying; required to publish Not needed to publish (the places may change), but publishing without places warns the team (action_publish() returns a notification); required before preparing the provisional resolution; the team assigns each selected person’s project and period
Documents Configured per call; a new call brings the five of art. 8 (_ems_student_documents, on create) Only the optional language certificates (_ems_staff_documents, on create and on the audience onchange); the plan is written in the form (PLAN_FIELDS)
Admission checks Requirements; a serious conduct record this course is pointed out, the team may exclude Requirements only
Scoring Art. 12 (A-F), A and F frozen at closing Art. 11 of the staff call (1-5): the panel, what the applicant declares (last mobility, seniority, language) and the merits the team records
Ranking Per modality One list for the whole call
Places Per modality Issue #772: project_place_ids (places per project, the team’s planning), offered as one pool (_ems_places(), the sum); staff only see the total
Modalities Levels and places; the project from the levels None. The team sets the mobility’s project_id (domain allowed_project_ids: the projects of the call’s table; _check_project refuses another), which brings the documents of its kind (project_kind = the project’s kind; write re-syncs the requirements). project_places (“2026-VET: 1 of 2 places left”) and project_places_over (a warning, not a block) on the mobility; places_without_project warns on the call (note 7.1) and the application list shows project_id from a staff call’s button (ems_staff_call context)
Dissemination - Not part of the plan nor of the rubric: the same obligation for everyone, a news item on the website and sharing it at a meeting if needed (two return steps of the checklist)
Identity document of the lists res.partner.document_id / passport_id hr.employee.identification_id / passport_id (_ems_identity_document)
Minimum score 50 0 (set by create() and the onchange of audience; hidden in the form)
Interview/evaluation deadline (interview_deadline) From date_close (_ems_deadlines()), like every deadline The same rule: it is the panel’s deadline
erDiagram
    ems_erasmus_call ||--o{ ems_erasmus_call_panel : "panel_ids"
    ems_erasmus_call_panel }o--|| res_users : "user_id"
    ems_erasmus_application }o--o| hr_employee : "employee_id"
    ems_erasmus_application ||--o{ ems_erasmus_plan_rating : "plan_rating_ids"
    ems_erasmus_plan_rating }o--|| res_users : "panel_member_id"
    ems_erasmus_plan_rating }o--o| res_users : "evaluator_id (the member, empty if abstaining)"
    ems_erasmus_application ||--o{ ems_erasmus_application_merit : "merit_ids"
Model Purpose
ems.erasmus.call.panel A panel member of a staff call (user, post), copied when the call is duplicated.
ems.erasmus.plan_rating One panel member’s rating of one application’s mobility plan (annex 2, criterion 1 “Mobility plan”: concreteness and relevance (to the job), each 1 / 0.5 / 0 points, and, since 2026-11-18, activity_kind, the activity of proposal A, 0.5 for a job shadowing or a teaching assignment and 0 for a course, so that the centre favours them over courses (adriamt); max 2.5. Their selection labels are the annex’s descriptions, their keys the points). The panel reads it from proposal A’s text: the application stores no activity type, which is only chosen on the mobility after accepting the place, and nothing checks it against that later choice (adriamt, 2026-11-18: only the application counts). The old transfer aspect was removed with no migration: the selection keys are the same, and no staff call had reached the panel in production. Unique per (application, panel member). Inherits ems.erasmus.evaluation.
ems.erasmus.application.merit A merit of criterion 3 (centre project: collaboration 0.5, coordination 1), with its justification.

Application form

The staff form (ems.erasmus.staff.application.wizard, over ANSWER_FIELDS['staff'], the same in the backend dialog and the portal) has three short blocks (adriamt, 2026-11-03 and 2026-11-13): (1) the mobility plan (annex 1), explained in one line and made of two proposals in the teacher’s own words, both required, proposal_a (the main one) and proposal_b (in case A can’t be done), each saying the activity, host, where, when and what they want to learn, with the annex’s examples as placeholders; how it will be applied is not asked (the separate plan_text went on 2026-11-13, with no migration: the 2026-27 staff call was not published in production, and Odoo keeps the orphan column). PLAN_FIELDS lists both, required to submit, and the rating shows them through related fields, so the panel reads them on screen and nothing else of the application, and gives one score; (2) “I have not done any Erasmus+ mobility at the Institut Puig Castellar” (declared_never_staff_mobility, help FIRST_MOBILITY_HELP: as staff, accompanying groups and other programmes don’t count; otherwise the team sets last_staff_mobility, criterion 2), the date at the centre (required, criterion 5), the language certificate and the centre projects (help CENTRE_PROJECTS_HELP, criterion 3); (3) optional and folded: support needs, image consent, notes. The application’s button says Fill in the form while it is a draft and Modify the application once submitted and still changeable (P05, P08). The mobility’s proposal starts with both proposals in its notes and the country named in A (_ems_create_for, _ems_country_in); the participant writes the exact entity and dates there and the Direction validates them as any proposal. A staff call asks for no CV and no identity document at application time (_ems_staff_documents: only the optional language certificates, so publishing a staff call needs no required document); the identity document is a staff preparation document. Support needs (confidential: groups Erasmus team and administrator), the declared language certificate (declared_language_level), image consent, notes. The controller saves only the answers of the call’s audience; _ems_portal_save refuses an activity outside the selection. employee_id is set when the application is created. is_minor is always false for staff.

Who sees a staff call (art. 6, ems.erasmus.call._ems_staff_can_apply, used by res.partner._ems_erasmus_calls, so by the portal card and by _ems_portal_get_or_create): an internal user whose employee is a teacher with an active ems.teaching in a group of one of the call’s staff_level_ids (Teachers of; a new staff call gets every FP level of the catalog, STAFF_LEVELS: CFGB, CFGM, CFGS, EFPS, PFI; required to publish), and the call’s validator_ids (Validates the activities, required to publish). Never the administration staff (asp) nor a teacher of ESO/BTX only. A new staff call fills validator_ids with _ems_staff_validators(): the Director (res.company.director_id) and the Head of Studies that find_head_of_studies() returns for most of the teachers of those levels (decided with the coordinator 2026-10-23: FP’s validates every applicant, also the language teachers who hang below ESO/BTX’s in the chart). The staff screens never show the project nor its places (the team’s planning): not in the application header, the offer nor the offer email.

Projects’ short name (issue #772). ems.erasmus.project.code (Short name, e.g. 2026-VET) is a stored compute from the agreement number (AGREEMENT_NUMBER: its year and VET/HED), editable; it is the display_name (the agreement number with its kind when there is none) and _rec_names_search covers both. The upgrade (migrations/18.0.0.48.0/post-migrate.py, to fold into the release version) turns each staff modality’s places into a line of the project its mobilities already use, or the only active project of its kind, fills that project on its mobilities without one, posts a note on the call when it can’t resolve it, and deletes the staff modalities (references nulled first).

Panel and plan ratings

Actions > Send plans to the panel (action_send_to_panel, staff call in its Scoring phase: closed and before the provisional resolution, which freezes the scores; issue #786) creates one rating per admitted application and panel member still without one, so it can be repeated after admitting more. It needs the call’s interview_deadline: each evaluator’s to-do is due that day in the company’s timezone (_ems_activity_date), and changing the deadline moves the open to-dos of the interviews and plan ratings (_ems_move_evaluation_activities). The daily task digest reminds the members of them. A panel member who applied to the call (_ems_candidate_partners: any application past draft) gets an abstention instead: no evaluator_id, reason Candidate in this call (art. 10). For any other conflict of interest the team writes the abstention_reason, which clears the evaluator (write); clearing the reason gives the rating back to the member. There are no substitutes (decided with the coordinator 2026-10-22): _check_evaluator only accepts the panel member, or nobody, and never a candidate of the call.

plan_score is the mean of the submitted ratings that are not abstentions; plan_complete needs every non-abstaining rating submitted and a rating for every panel member (call.panel_ids). A pending rating leaves the score incomplete.

What a panel member sees: only their ratings (record rule evaluator_id = user), and, so they can open the plan, the application document lines whose call document is panel_visible and not confidential, of the applications they rate (record rule on ems.erasmus.application.document, read only); the rating shows those files (plan_attachment_ids). Nothing else of the application.

Criteria (art. 11 of the staff call)

  Criterion Field(s) Points
1 Mobility plan plan_score → score_plan max 2.5
2 Last staff mobility last_staff_mobility (team correction) else declared_last_staff_mobility → score_last_mobility never / older 1, two courses ago 0.5, recent 0
3 Centre projects merit_ids (project kinds) → score_projects sum, max 2
4 Languages language_level (checked by the team) else declared_language_level (the applicant’s) → score_staff_language B2 1.5, C1 2, C2 2.5 (B1 0)
5 Seniority seniority (team correction) else declared_seniority → score_seniority < 1 year 0, 1-2 1, 2-5 1.5, ≥ 5 2

Declared values (_compute_declared_staff_bands): the applicant only ticks that they never had an Erasmus+ staff mobility at the Puig (declared_never_staff_mobility → band never); for everyone else the team sets last_staff_mobility from the centre’s records (the 2026-11-03 review). The month they joined the centre (declared_centre_start_date) is required to submit; seniority counts whole months up to the call’s closing date (company time). The portal sends it as an <input type="month"> value (YYYY-MM, stored as the 1st).

score_complete needs the plan complete, criteria 2 and 5 (declared or corrected) and merits_checked (stamped like every manual criterion, so “no merits” is an explicit answer). Criterion 4 never blocks: no declared certificate counts as none (_ems_staff_language_level).

Ranking (_compute_rank, _ems_rank_key): one list per call, once every admitted application is complete. Tie-breaks (art. 11 of the staff call): plan score, then more seniority at the centre by the month and year declared in the form (declared_centre_start_date, earlier first; within the same criterion-5 band too), then the draw the coordinator runs (action_draw_ties). Result (_ems_ranking_result): selected within the sum of every modality’s places, reserve after them.

Resolutions, offers and export

Access (phase 4)

Model Erasmus team Head of Studies / Director Panel member (ems.group_erasmus_panel)
ems.erasmus.call.panel rwcu r -
ems.erasmus.plan_rating rwcu - (unless in the panel) rw own (rubric, notes)
ems.erasmus.application.merit rwcu r -
ems.erasmus.application.document rwcu r, not confidential r, panel_visible lines of the plans they rate

The team opens the plan ratings from the call’s Plan ratings button; the panel, from Erasmus+ > My participation > Plans to rate.

Mobility preparation (phase 5, #687)

Accepting a place offer (ems.erasmus.offer.action_accept) creates the participant’s mobility. The application keeps the selection; the mobility holds everything after it.

erDiagram
    ems_erasmus_call ||--o{ ems_erasmus_destination : "destination_ids (students)"
    ems_erasmus_destination }o--|| ems_erasmus_call_modality : "modality_id"
    ems_erasmus_call ||--o{ ems_erasmus_call_document : "preparation_document_ids (stage preparation / return)"
    ems_erasmus_call ||--o{ ems_erasmus_call_task : "task_ids (checklist)"
    ems_erasmus_application ||--o| ems_erasmus_mobility : "mobility_ids"
    ems_erasmus_mobility }o--o| ems_erasmus_destination : "destination_id"
    ems_erasmus_mobility }o--o| res_partner : "host_partner_id, host_contact_id"
    ems_erasmus_mobility ||--o{ ems_erasmus_application_document : "document_ids"
    ems_erasmus_mobility ||--o{ ems_erasmus_mobility_task : "task_ids"
Model Purpose
ems.erasmus.destination A destination of a students’ call, in one modality: country, city, places, the levels it suits (empty: all), dates, host entities, notes. free_places = places minus its mobilities not cancelled. Not copied with the call (destinations change every year).
ems.erasmus.mobility One per accepted application (unique(application_id)): destination, the proposal and its decision, country, city, host entity (a company contact) and its contact person, dates, documents and checklist.
ems.erasmus.call.task A checklist step of the call (not a document): when (stage: before leaving / on return), only for some modalities.
ems.erasmus.mobility.task That step for one mobility, ticked by the team (who and when stamped) or, for a staff mobility, by the teacher (see below).

Documents. ems.erasmus.call.document has a stage: application (phases 1-4), preparation or return. The call’s document_ids shows only the application ones (One2many domain), so the application’s lines and every earlier rule are unchanged; preparation_document_ids holds the other two. Each one (and each checklist step, ems.erasmus.call.task) can be limited to some modalities (modality_ids) and to one project (project: KA121-VET or KA131-HED, matched against the mobility’s modality, so a default can say “VET only” before the call has modalities), and says who signs it outside EMS (sign_participant, sign_guardian for minors, sign_director, sign_coordinator, sign_tutor: the centre’s tutor in sBID, sign_host; shown as signers). The mobility’s lines are ems.erasmus.application.document records with mobility_id set: same review, every version kept, a new upload goes back to review. A new call gets default documents and steps per audience (_ems_preparation_documents, _ems_preparation_tasks: art. 17 of the students’ call, art. 15 of the staff call), editable. _ems_sync_requirements() adds what the mobility’s modality needs and is missing, never removing a line: on creation, when the modality is changed on the application (application.write), when a staff member’s project is assigned, and when the call is saved with changes to preparation_document_ids or task_ids (issue #788: _ems_sync_open_requirements() on the call’s mobilities still going on; there is no button to remember). A group mobility does the same when saved with changes to requirement_ids. Removing a call document (ems.erasmus.call.document.unlink(), call or group mobility alike) removes its empty lines everywhere; if any line is evidence (_ems_evidence(): a file, a team file or valid) it raises a translated UserError naming the documents instead of the database’s ondelete='restrict' error, so nothing handed in is ever deleted.

Filled in by EMS (issue #788): the mobility’s project_id, on creation and when the modality changes, when exactly one project is possible (allowed_project_ids: a single active project of the modality’s kind, or a single project among a staff call’s places; _ems_fill_project()); two or more are left to the team. Choosing the host entity (on the mobility and in the agreed destination’s dialog) copies its country and city when empty (host_place_vals()). Validating a staff proposal copies country, city and dates but never looks up or creates the host entity: the name the teacher types (proposal_host) is only a guide, and the team sets the real entity when preparing the documents (decided by the Erasmus+ coordinator, 2026-11-13). A project’s kind comes from its agreement number (-KA121-VET-/-KA131-HED-) like its code, and a support rate’s band_scope from its action (KA131-HED: the whole project; KA121-VET: the same kind of mobility); both stay editable.

New call fields: choice_turn_hours (default 72) and choice_open.

Deadlines, per document: due_basis (destination: after the destination is set, before_start: before leaving, after_end: after returning) and due_days; each line computes its deadline from the mobility’s destination_date (stamped when it moves to preparing, _ems_set_state), date_start or date_end. Handled by (handled_by): participant (they upload it), team_to_sign (the team attaches the filled-in document to the line’s prepared_attachment_ids; the participant downloads it, signs it and uploads it signed, and is not asked for it until then) or team (the team provides it, e.g. the insurance policy: the participant only downloads it, can’t upload to it, is never reminded of it, and the line counts as complete once prepared_attachment_ids has a file). Defaults (art. 17 and annex 1): students, the European Health Insurance Card and, for minors, the family’s and the Mossos d’Esquadra’s authorisations (30 days after the destination), the OLS certificate with the English level (30 days after the destination), the inclusion documentation (optional, confidential), the grant agreement and the learning agreement (team_to_sign, 30 days before leaving at the latest, ideally 90), the insurance policy (team, 30 days before leaving), the sBID agreement (REF5) and activity plan (REF6) (team, requirement curricular) and, on return, the certificate of stay (team_to_sign, signed by the tutor at the host company, 30 days after returning), the Europass mobility document (team, KA121-VET, issued after the mobility with the learning outcomes and actual dates) and the recognition of ECTS credits (team, KA131-HED, requirement curricular). Staff: health card, grant agreement, insurance policy, learning agreement (KA121-VET) or mobility agreement (KA131-HED), on return the Europass mobility document (KA121-VET, plus an optional certificate of stay or attendance for when the dates or the activity need proving) or the certificate of stay or attendance (KA131-HED), and the report with evidence.

Conditional requirements. A call document’s requirement is required, optional, minor (the application’s is_minor), curricular: required only when the mobility’s placement_type is curricular (a work placement managed in sBID, the default for a student, computed once and then editable by the team; extracurricular and graduate leave it optional), or short_blended: required only when the mobility is_short_blended, and hidden on the portal otherwise (the student’s virtual component, a PDF with their preparation, KA131-HED, in the record’s category 02).

Opening date. A call document’s open_days (mobility documents before leaving) keeps it closed until that many days before leaving: the line’s open_date is date_start - open_days, and _ems_is_open() is false before that day or while the dates are unknown. A closed line shows on the portal with the day it opens and no upload input; _ems_portal_upload ignores it and _ems_documents_to_correct (the weekly reminder) leaves it out. It still counts for preparation_complete. The virtual component opens 30 days before leaving and is due the day before (due_basis='before_start', due_days=1). A checklist step (ems.erasmus.call.task) has its own requirement: required or short_blended, which only counts when the mobility is_short_blended (KA131-HED modality and a stay of SHORT_BLENDED_MAX_DAYS, 30, days or fewer). The mobility line computes is_required; _compute_complete and the portal’s steps only take the required ones, and a document that is not required can still be attached. Signers by default: the Director signs the grant agreement and the sBID agreement; the Erasmus coordinator, the learning agreement and the Europass mobility document; the family of a minor, the grant agreement and the learning agreement too; the centre’s tutor, the sBID activity plan. Not asked for, EMS already has them: identity document, bank account, personal details, emergency contact.

Commitment letter (annex 3): the call’s commitment_text (HTML, filled in with _ems_commitment_text() on a new students’ call, translatable): the commitments, the terms the centre’s former paper “assumpció de responsabilitat” carried (the centre’s responsibility is limited to the agreed programme; a serious breach means being sent back, at the participant’s or family’s cost), and a note that a minor’s family authorises taking part by accepting it, so applying needs no family authorisation. The participant accepts and signs it on the portal (action_sign_commitment, portal step commitment): EMS keeps a copy of the text (commitment_signed_text), who (commitment_signed_by_id), when and the IP address; the forms say it in one line (commitment_status, commitment_guardian_status, issue #784). commitment_pending (text on the call, not signed yet) blocks preparation_complete and is part of the weekly reminder. A minor student’s family signs it too (commitment_guardian_* fields, action_sign_commitment(guardian=True)), in either order and over the same text: the first signature stamps commitment_signed_text and the second signs that copy (_ems_commitment_text()). commitment_guardian_pending (students’ call, partner not adult, not signed by the family) also blocks preparation_complete. The family signs on /my/erasmus (route /my/erasmus/commitment/<mobility_id>), which lists res.partner._ems_erasmus_guardian_mobilities(): the mobilities in preparation of the minors it acts for (_ems_portal_can_act_for); that also makes the portal’s Erasmus+ card visible to it. _ems_remind_guardians() emails every family contact with an address (template email_template_erasmus_commitment_guardian) when the mobility moves to preparing and in the weekly reminder cron.

Weekly self-assessment during the stay. The call’s self_assessment_question_ids (ems.erasmus.call.question: name, kind text or rating 1-5; four on a new students’ call, _ems_self_assessment_questions(), editable; none on a staff call, so staff get no self-assessment unless the team adds questions). The stay is split into weeks from date_start (_ems_self_assessment_weeks(): (week, first day, last day), the last one cut at date_end). While the mobility is preparing (it stays so until the team closes it after the return), the portal offers a form for every week already begun and not answered (_ems_self_assessments_open(), portal step self_assessment, _ems_portal_self_assessment(week, answers): every question answered, ratings 1-5, each week once, unique(mobility_id, week)). Each answer (ems.erasmus.self_assessment.answer) keeps the question’s text as asked. The weekly reminder adds the weeks already over and not answered (_ems_self_assessments_missing()). The team reads them on the mobility (Self-assessment tab, self_assessment_progress “answered / weeks”), prints them (report ems.action_report_erasmus_self_assessment, bound to the mobility) and the exports add that PDF to the participant’s record, category 03_Durant_la_mobilitat (see records.md). Access: Erasmus team and administrator read/write (the team can delete a week for the participant to answer it again), Head of Studies read.

Projects (ems.erasmus.project, menu Erasmus+ > Projects): the centre’s active projects (agreement number, kind KA121-VET / KA131-HED, dates, active). Each mobility’s project_id must be of its modality’s project kind (_check_project; the field’s domain offers only those).

Mobility states

stateDiagram-v2
    [*] --> choosing: offer accepted
    choosing --> preparing: destination chosen / one destination / proposal validated
    choosing --> preparing: Set the agreed destination (team)
    choosing --> cancelled: renounced / cancelled
    preparing --> done: Close (return documents and steps complete)
    preparing --> cancelled: renounced / cancelled by the team (with a reason)

Phase (issue #785). Preparing covered everything from the destination to the closing, so the status bar, the lists, the kanban (grouped by it) and the portal show phase instead: the state, except that a preparing mobility is in its Mobility stay from date_start (that day included) and on Return home from the day after date_end (the same day stay_over turns true), in the company’s timezone. It is stored so it can be grouped and filtered; the hourly cron ems.ir_cron_erasmus_mobility_phase (_cron_update_phase) recomputes only the mobilities whose dates have overtaken their phase (one indexed search, usually empty). Business rules keep reading state. preparation_complete and return_complete are no longer shown (the phase says where the mobility is); action_close still checks them.

The state changes only through the actions. Cancelling frees the place (_ems_cancel): the accepted offer and the application become renounced; the place is then offered with the existing wizard, never on its own.

What each state offers and what is missing (issues #786, #787)

Destination choice (students, art. 15)

call.action_open_destination_choice() (after the definitive resolution, with destinations) sets choice_open and runs _ems_advance_choice(), which runs again after every choice, proposal, rejection and cancellation. Per modality:

Assigning copies country, city and dates from the destination - and its host entity, with the entity’s tutor when it has a single contact, when the destination has only one - and emails email_template_erasmus_mobility_assigned.

Proposals and their decision

The same fields serve a student’s own destination and a staff member’s activity: proposal_*, proposal_state (pending / validated / rejected), decision_note, decided_by_id, decision_date.

  Student Staff
Sent From the portal while choosing, with the host’s written commitment (required) Filled from the application when the mobility is created (proposal_state empty); the staff member completes it with the exact dates (proposal_date_start/_end) and the responsible declaration for the absence (leave_declaration), both required, and sends it from the portal, again after a rejection
Validated by (_ems_can_validate) Erasmus team Direction (_ems_validators): the call’s validator_ids (the Director and the Head of Studies of FP), never the applicant; without anyone, the administrators. The Erasmus team cannot
Validated Preparing, country, city and dates from the proposal Same
Rejected (needs decision_note) Back to choosing the centre’s destinations Proposes another activity on the portal

A pending proposal schedules a to-do (mail.activity) for every validator, marked done on the decision; a validation emails email_template_erasmus_mobility_assigned (students) or email_template_erasmus_proposal_validated (staff), a rejection email_template_erasmus_proposal_rejected. The administrator can always validate, but gets no to-do. decision_note (Comment on the decision) is required to reject and optional to validate; the validated email and the portal show it.

A change after validation (staff, issue #697): while _ems_can_change_proposal() (a staff mobility in preparing, not pending, date_start still in the future, company’s today), the participant sends a new proposal from the portal (Change the activity or the dates), or the team edits the Proposal tab and clicks action_request_revalidation. Either sets proposal_state = 'pending' and asks the validators again, keeping the mobility’s validated dates and its destination_date (_ems_set_state only sets it when empty). Validating copies the new proposal onto the mobility (the training absence follows, _ems_sync_training_leave); rejecting keeps the validated activity and the email says so.

Preparation, return and closing

Graduates

The course transition (_apply_graduates) does not retire a graduate with an open mobility (res.partner._ems_erasmus_open_mobility): it is reported and keeps the portal. When the mobility is closed or cancelled, _ems_erasmus_release_graduate() retires an active alumnus with no open mobility left, as the transition would have (res.partner._ems_retire_graduate, shared with it).

Portal (phase 5)

POST /my/erasmus/call/<id>/mobility/<step> acts on the logged-in user’s own mobility of that call: choose (destination_id), propose (the proposal_* fields and proposal_files), upload (document_<call document id>) and renounce (reason). The call page shows the Your mobility card (ems.portal_erasmus_mobility). GET /my/erasmus/call/<id>/mobility/file/<attachment id> downloads a file to sign of their own mobility (prepared_attachment_ids).

Access (phase 5)

Model Erasmus team Head of Studies Director Portal
ems.erasmus.destination, .call.task, .mobility.task rwcu r r via controller
ems.erasmus.mobility rwcu r + decision_note and validating staff proposals (write() guard) same as Head of Studies via controller

A teacher reads their own staff mobility and its steps (ems.erasmus.mobility.task: read ACL for group_teacher plus rule_erasmus_mobility_task_staff_own, with _staff_all so the team’s and the Head of Studies’ rules are not narrowed). They tick or untick a step with action_staff_done/action_staff_undo (sudo after staff_can_tick/staff_can_untick): a step before leaving only on an open mobility; a step on return only once the stay has started (phase in RETURN_TICK_PHASES: stay and return, never once closed; P17, adriamt 2026-11-13: the news item is often written on the last day); and untick only what they ticked themselves (issue #787, 8.8). The team ticks any step at any time.

Menu Erasmus+ > Mobilities > Individual mobilities (team, Head of Studies, Director), with a Proposal to validate filter.

Grants, provision of services and host entities (phase 6, #697)

The coordinator calculates each participant’s grant in the Beneficiary Module and enters it on the mobility. The centre may pay part of it directly (flights, accommodation, course fees): those provisions of services are deducted, and the Secretary transfers the rest to the participant (art. 5 of both calls).

erDiagram
    ems_erasmus_mobility ||--o{ ems_erasmus_provision : "provision_ids"
    ems_erasmus_invoice ||--o{ ems_erasmus_provision : "provision_ids (one share per participant)"
    ems_erasmus_invoice }o--o{ ems_erasmus_mobility : "mobility_ids"
    ems_erasmus_mobility ||--o{ ems_erasmus_payment : "payment_ids"
    ems_erasmus_mobility }o--o| res_partner : "host_partner_id (is_erasmus_host), host_contact_id (its tutor)"
Model Purpose
ems.erasmus.provision Part of a grant the centre pays directly: concept (travel, accommodation, course fees, other), description, amount, the invoice it comes from (optional). Added by hand on the mobility’s Grant tab, or created by an invoice.
ems.erasmus.invoice A supplier’s invoice the centre paid for some participants: number, supplier, date, concept, project, amount, file, mobility_ids. Creating it, or changing its amount or participants, splits it again into equal shares (_ems_split(): rounded down to the cent, the remainder on the first share); a share can then be edited by hand, and unassigned_amount shows what is left. Changing only the concept or description updates the shares in place.
ems.erasmus.payment An amount the Secretary transfers: kind prefinancing, final or single; amount; state to pay / paid, who and when, receipt_ids (the transfer receipts); the participant’s IBAN and holder (bank_account, bank_holder: their first res.partner.bank, read with sudo).
ems.erasmus.transfer.wizard Register transfer: the Secretary picks the grant payments or the invoices one bank transfer pays (several at once, e.g. a batch of grants or a travel agency’s invoice), its date and its receipt; one ir.attachment is created and linked to every one of them, which become paid.
ems.erasmus.project.document A file of a project that no other EMS record holds (the grant agreement, budget follow-up, exceptional costs, dissemination, the final report…), in one of the project’s five categories (category), optionally about some participants, whose records then show it (see records.md).

On the mobility: grant_amount, prefinancing_percent (default 80, above 0 and up to 100), provision_amount and grant_net (= grant - provisions, what the participant receives). Request the first payment (action_request_prefinancing) creates the prefinancing, grant_net x percentage, or a single payment at 100 %. Request the final payment (action_request_final_payment) creates the rest, grant_net minus every payment already requested, so a change of the grant or the provisions after the prefinancing lands in it. Each can be requested once (can_request_prefinancing, can_request_final), from the preparing state, and never for nothing (zero or less raises). An unpaid payment can be deleted by the team and requested again.

Paying: only the Secretary (or the administrator) registers a transfer (action_register_transfer on payments and invoices opens the wizard) or undoes one (action_mark_unpaid opens ems.erasmus.undo.transfer.wizard, with a required reason, audit D-18); both write with sudo after checking the group (_check_payer). A direct write of state/paid_date/paid_by_id/receipt_ids raises, a paid payment cannot be changed or deleted and a paid invoice cannot be deleted. Invoices have the same state, paid_date, paid_by_id and receipt_ids as payments.

The Secretary’s tasks: every payment requested and every invoice created schedules a to-do for whoever holds the Secretary role (ems.role_secretary; without anyone, the administrators), _ask_transfer(); registering the transfer marks it done and undoing it schedules it again. Both models inherit ems.base for it, so the Secretary sees what is left to pay every working day in the daily pending-tasks digest (docs/en/developers/shared/task_digest.md), with no mechanism of its own.

Portal: once the mobility is in preparation and has a grant, the participant sees it (_ems_portal_grant()): the grant, each provision of services, what they receive and each payment with its state. The call’s page also links the published call.

Host entities: res.partner.is_erasmus_host marks a company, school or course provider that hosts participants; its contacts are the tutors at destination, with their email. Menu Erasmus+ > Configuration > Host entities (action_erasmus_host_entity: its own list and search view, the native kanban and form). The mobility’s and the destination’s host fields only offer host entities, the mobility shows the tutor’s email (host_contact_email) and picks the tutor automatically when the entity has only one contact. The Learning Agreement already says it is signed by the host entity (sign_host); sending it to the tutor to sign waits for the integrated e-signature.

Projects: the team assigns each mobility to a project (project_id, phase 5) before entering it in the Beneficiary Module. Payments and invoices carry the project for the Secretary. The centre’s active projects are seeded once from data/custom/erasmus/ems.erasmus.project.csv (agreement number, kind, dates; maintained in the app afterwards, like every data/custom/ record). A project also has its budget (grant awarded), final_payment_date and keep_until: SEPIE asks to keep the documents 3 years after the final payment of the grant, 5 when it is above 60,000 €.

Economy: what each mobility commits and has been paid, the grant’s amendments, SEPIE’s transfers, the project’s own expenses, the organisational support, the economic panel and its Excel export are described in economy.md (issue #762).

Documents and exports: the project’s documents in five categories, each participant’s record in four, and the ZIP exports (a record or a whole project, with index, manifest and SHA-256 hashes, logged) are described in records.md. The host entity also has its Erasmus+ erasmus_oid.

The host entity’s form is the general contact form (base.view_partner_form plus EMS’s views), whose details block (address, country, website, email, phone, OID) is hidden by read_only_user, meant for the students’ data. res.partner.can_edit_erasmus_host (non-stored: ems.group_erasmus and the contact is a host entity or a host entity’s tutor, issue #777) shows it to the Erasmus team there and nowhere else. Known limit, decided with the coordinator (2026-11-09): that form also reads student data (ems.enrollment, ems.enrollment.slot, ems.authorization, ems.student.benefit, ems.student.document, ems.study), which ems.group_erasmus alone cannot, so a team member must also be a teacher (both are today), or the form ends in an access error. A form of its own for host entities would lift this limit.

An invoice is either a group’s or some participants’ (_check_group_or_participants, issue #777): mobility_ids makes shares of the participants’ grants and group_mobility_id counts in the group’s figures and pocket money, so both at once would count it twice. A group’s invoice has no shares, so its unassigned_amount is 0. The constraint only checks what is written from now on.

Access (phase 6)

Model Erasmus team Secretary Head of Studies / Director
ems.erasmus.provision, .invoice rwcu r (+ register the invoice’s transfer) r (Director, issue #762)
ems.erasmus.project.document rwcu rwc r
ems.erasmus.transfer.wizard, .undo.transfer.wizard - rwcu -
ems.erasmus.payment rwcu (unpaid only; write() guard) r + register the transfer (wizard) r (Director, without the bank account)

Undoing a transfer (action_mark_unpaid, Secretary, through its wizard) posts in the payment’s or invoice’s chatter who undid it and why, when it had been paid and by whom, with its receipts attached; its state is tracked. A paid invoice cannot change, as a paid payment cannot. The first payment (prefinancing or single) and the final one exist once per mobility: a unique index (ems_erasmus_payment_once_per_mobility, created in init(), so on install and on upgrade) refuses a second one requested at the same moment, which the check in action_request_* cannot see from its own transaction. A payment is only requested for a mobility in preparation or closed. | ems.erasmus.call, .project | rwcu | r | r | | res.partner | r every contact; wc only host entities and their contacts (rule_contact_erasmus_*) | (unchanged) | (unchanged) |

The mobility’s Grant tab and its grant columns are only for the team (groups=), so the Head of Studies and the Director, who read mobilities, never load the grant models. Menus Erasmus+ > Configuration > Host entities (team), Erasmus+ > Projects and Erasmus+ > Financial management > Grant payments, Services paid by the centre and Project expenses (team, Secretary and, read-only, the Director; the Secretary sees only those under Erasmus+). The project form’s tabs follow the same split (mobilities: team and Head of Studies; services paid by the centre, project expenses and payments: team, Secretary and Director). The Secretary also enters services paid by the centre and reads the individual and group mobilities to say whom they are for (issue #791; rule_erasmus_mobility_staff_all, rule_erasmus_group_mobility_head_of_studies).

Erasmus+ history (ems.erasmus.history)

A person’s Erasmus+ participations as EMS has them: a read-only SQL view (_auto = False, models/erasmus/history.py), one line per individual mobility and one per group mobility participant, leaving out cancelled mobilities and withdrawn participants. It keeps text and dates only (the call’s or group mobility’s name, project kind, country, city, dates, Planned or Completed), so whoever reads it needs no access to the Erasmus+ models.

flowchart LR
    M[ems.erasmus.mobility<br/>not cancelled] --> H[ems.erasmus.history]
    P[ems.erasmus.group.participant<br/>active, mobility not cancelled] --> H
    H --> F[Student form<br/>Studies tab, under the academic history]
    H --> A[Application<br/>Scoring tab, for First mobility]
Model Teacher / Secretary / Head of Studies / admin / student data reader / Erasmus team
ems.erasmus.history r

Review of 2026-11-02 (end-to-end walk-through by role)

Dates and numbers in the screens (issue #778)

Texts of the screens (issue #779)

Selection lists (issue #781)

Mobility, group, project, economy and configuration lists (issue #782)

Staff screens in use during the 2026-27 calls (issue #810)

Empty lists and help texts (issue #783)

Form headers and smart buttons (issue #784)