ems.student.previous_curriculum_recordThe 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.
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
unique (student_id, curriculum_code)).curriculum_code “CFPS ICB0”, curriculum_name “CFPS Desenvolupament
d’aplicacions multiplataforma (LOE)”): the curriculum is what identifies the studies, and it is not
in EMS. study_id is only informative: the current study whose code ends with the curriculum’s
token (CFPS ICB0 → CFGS_ICB0).sequence,
kind), so the record reads like the document in a single list.grade): a number, NP, Ap, CV… A module is only graded once all its
units are. is_passed (stored) comes from grade_passes(): a number from 5, or Ap/A/Apte,
CV/Convalidat, EX/Exempt.source_application defaults to SAGA, the application that issued 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.
Cognoms i nom row), centre (Municipi row),
curriculum (Nom del cicle formatiu row), years (Anys acadèmics, “De 2020 a 2022”), and the
Observacions box as notes.student_document_id, the last word printed from the DNI column of the Nom i cognoms de
l'alumne/a row, since the number is not aligned with its title), the centre and the curriculum
by the Codi/Nom rows after Dades del centre and Matriculat al cicle formatiu.Mòdul ... Unitat formativa header of each page (either case) and stops at the signatures,
the closing sections (Observacions, Diligència de validesa, I, perquè consti) or the page’s
footer (the form code, Y508-002/06-10), as a certificate’s page has no signatures. Codes are
digits (001, 00101) or, for a module of the issuing centre’s own, letters (AOC, AOCOA),
only taken as a code when MP<n>/UF<n> follows. Each line is split where its unit code starts,
searched from near the header’s Unitat formativa column, since the module’s sitting (Ext.)
reaches under that title and a page may shift its rows. A line without a unit code (a wrapped
name) is split where text starts in the units’ column (from 1 left to 8 right of the title: the
codes’ own column, where wrapped unit names also start), else just right of the title. Each half
is read on its own: a code opens a row, anything else continues the name above (a word cut at its
hyphen is joined without a space).AcademicRecordPdfError, shown as a message in the
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
ems.base.get_user_can_edit_history():
secretariat, academic administration, Head of Studies, Deputy, Director). The record is created
with sudo() after that check, as the Head of Studies has no create right on it.ems.base.get_certificate_student_problem(), shared with the Esfera reader:
identifier not read, student without IDALU, or a different one, all block creation. A grades
certificate, which carries no IDALU, is checked the same way against the student’s
document_id (DNI/NIE), compared without spaces, dots or hyphens and in uppercase: a student
without one, or a different one, blocks creation.all_modules_passed proposes it when an academic
history is read; the user confirms or corrects it and may give its date. A grades certificate
never proposes it, as it may list only some of the cycle’s modules.res.partner.history_line_ids)
and on the convalidation request (Academic history tab, student_history_line_ids, related, same
groups as the per-course history). Its lines are ems.student.history_line, a read-only SQL view
(_auto = False) that joins the courses of ems.student.year_record (even ids) and the previous
curriculum records (odd ids): course or years, study or curriculum name, group, centre, result,
title, subjects or modules count, attendance. No data is copied and no process reads it: every
process keeps working on its own model. The ems_history_lines widget
(static/src/js/backend/history_lines_field.js) opens the record behind a clicked line
(action_open_record(), in a dialog) and reloads the form when it closes. The view’s ACL is
read-only, for the same groups that read the history.has_centre_title on a convalidation request also counts a previous curriculum record with
the title obtained whose centre_code is this centre’s (res.company.center_code).| 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. |
| 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.