EMS

Technical Reference: ems.student.previous_curriculum_record

Overview

The academic history of a student under a previous curriculum (issue #672): a VET cycle of an earlier law (LOE, organised in units, unitats formatives or UF, instead of learning outcomes) that the Departament d’Educació managed in SAGA before Esfera. Its modules do not map onto the current curriculum (different numbering, hours and modules, units instead of RAs, no course per module), so it is not an ems.student.year_record: it is kept apart, as printed on its Historial acadèmic or its Certificat de qualificacions de mòduls i unitats formatives (issue #732), and only looked up, typically to decide a convalidation request.

Students still studying a previous curriculum are not managed in EMS: only their documents are imported, for consultation.

See also: year_record.md (the per-course history, and the previous record of the current curriculum from an Esfera certificate), convalidation.md.

Hierarchy and relations

classDiagram
    class res_partner {
        previous_curriculum_record_ids
        history_line_ids
    }
    class ems_student_previous_curriculum_record {
        student_id
        curriculum_code
        curriculum_name
        study_id
        source_application
        centre_code / centre_name
        start_year / end_year
        title_obtained / title_date
        certificate_file
        notes
        module_count / passed_module_count
    }
    class ems_student_previous_curriculum_record_line {
        sequence
        kind: module | unit
        code / name / hours
        grade (text)
        sitting
        is_passed
    }
    class ems_student_history_line {
        SQL view: year records + previous curriculum records
        year_record_id / previous_curriculum_record_id
    }
    class ems_convalidation {
        student_history_line_ids
        has_centre_title
    }
    res_partner "1" --> "*" ems_student_previous_curriculum_record
    ems_student_previous_curriculum_record "1" --> "*" ems_student_previous_curriculum_record_line
    ems_student_history_line ..> ems_student_previous_curriculum_record
    ems_convalidation ..> ems_student_history_line : related, read only

Reading the document (models/grades/previous_curriculum_pdf.py)

Two documents are read, both with pdftotext -layout (same reason as the Esfera reader, year_record.md), reusing its pdf_to_text() and _value_below(). The heading tells them apart (Certificat de qualificacions, else unitats formatives), and is_certificate says which one was read.

Import wizard (ems.previous_curriculum_wizard)

sequenceDiagram
    actor S as Secretariat / admin / Head of Studies
    participant P as Student form
    participant W as Import wizard
    participant R as Previous curriculum record
    S->>P: Actions > Add a previous curriculum record
    P->>W: open (default_student_id)
    S->>W: upload the Historial acadèmic or Certificat de qualificacions PDF
    W->>W: read it: header + review grid (modules and units)
    W->>W: propose Title obtained if every module listed is passed (not on a certificate)
    W-->>S: warning if the IDALU (or the certificate's DNI/NIE) does not match
    S->>W: correct grades / sittings, confirm the title and its date
    S->>W: Create record
    W->>W: check role, document read, IDALU or DNI/NIE, not imported yet
    W->>R: create (sudo) with every line and the PDF
    W->>P: audit note in the chatter

Where it is shown

CRUD flow

Operation How
Create Only the import wizard (form views have create="0").
Read Student form, convalidation request, Previous curricula list.
Write Secretariat and administration correct a grade, the title or the notes on the form.
Delete Academic administration only.

Access control

Role Record and lines Import wizard
Teacher (every teacher) read -
Head of Studies / Deputy / Director read yes (writes through sudo())
Secretariat read, write, create yes
Academic administration read, write, create, delete yes
Student data reader read -

Access is ACL-only (no ir.rule), the same reach as the academic history: the whole teaching staff reads it.