EMS

Technical Reference: quality management (ems.quality.*)

Overview

The ems.quality.* models bring the centre’s ISO 9001 quality management system inside EMS. This document is the area overview; each model gets its own reference as it lands. The design of record for the whole feature, including the phases still to come, is plans/quality_iso.md.

Phase 1 (this one) delivers the foundation: the embedded process map, the documentary structure (processes, procedures and documents, each with its Drive link), and the unified action/agreement model. It is visible only to quality coordination and management; the staff-facing application arrives in phase 2 with the minutes.

Module files: models/quality/ · Views: views/quality/ · Security: security/groups.xml, security/ir.model.access.csv, security/rules/quality.xml


Model map

graph TD
    PROC["ems.quality.process<br/><i>PE1…PS2</i>"] --> PROCED["ems.quality.procedure<br/><i>PE3.01, PE3.04…</i>"]
    PROCED --> DOC["ems.quality.document<br/><i>controlled documents</i>"]
    PROC --> DOC
    ACT["ems.quality.action<br/><i>agreement / action</i>"] --> FUP["ems.quality.followup"]
    ROLE --> PROCED
    ROLE --> DOC
    ROLE --> ACT
    COURSE["ems.course"] --> ACT
    DOC -. "supersedes" .-> DOC
    ACT -. "phase 2+: origin" .-> FUTURE["minutes, records,<br/>objectives, audits"]

Three ideas carry the whole area and are worth stating before the field tables:

  1. One owner per piece of information. A controlled document lives in the centre’s Drive, and its version, state, dates and owner are written there and only there. EMS keeps where each document sits in the structure and its link, nothing else, so nobody updates the same thing twice.
  2. Responsibility is a post, not a person. Every owner field of an action points at ems.role (Director, Head of studies, Secretary, Quality coordinator…) and resolves to the employee holding it. The centre’s own records work this way, and it survives someone changing job in September.
  3. An agreement and an improvement action are the same thing. One model, ems.quality.action, with a type. That is what makes a single “what do I owe and by when” screen possible instead of one per origin. Meetings > Agreements (action_minute_agreement) is that screen for the staff: it opens on the facets Mine, Where I am involved (same filter group, so ORed) and Open.
  4. State is computed, never typed. It derives from the latest follow-up entry, so changing state requires recording why.

Documentary structure

Three models, under Quality > Documentation (with the process map first, so it is what clicking Quality opens), that hold only the structure and the links:

Model Fields
ems.quality.process code (unique, PE1…PS2), name, kind (strategic / key / support), sequence, active, procedure_ids, document_ids, url, embed_url
ems.quality.procedure code (unique, PE3.01), name, process_id (required), document_ids, active, url, embed_url
ems.quality.document code (unique when set, nullable: some documents have no code yet), name, procedure_id, process_id (computed from the procedure, editable when there is none), url, embed_url, is_process_map, active

A process and a procedure each have their own sheet in Drive (the one the process map links to), so all three carry a link, through the shared abstract model ems.quality.link (models/quality/link.py). The process and procedure forms show it in a first Document tab.

There is deliberately no version, state, date, owner or distribution field: the document itself, in Drive, is the only place those are kept. A document no longer in force is archived (active = False).

url (from ems.quality.link) is the ordinary address people copy from the browser; Open document (action_open_document) opens it in a new tab, where Google Docs edits it. embed_url is derived from it (_EMBEDDABLE_LINKS in models/quality/link.py, which also accepts the /u/<n>/ form some links carry): Google’s own /preview address for Docs, Sheets, Slides, Drawings and Drive files, which the forms show in an <iframe> across the full width of the window (the three forms carry class="o_quality_wide_form", static/src/css/backend/quality_document.css) (field widget ems_quality_document_preview, static/src/js/backend/quality_document_fields.js). No second link, no “Publish to the web” copy and no extra module: the frame is served by Google and follows the file’s own sharing, so the viewer’s browser must be signed in to a Google account that can open the file. Any other address gets no preview, only the button.

Process map

Quality > Process map, the first entry of the app, is a server action (ems.action_quality_process_map_open → ems.quality.document.action_open_process_map()) that opens the form of the document with is_process_map set, so the map is an ordinary document of the structure: its link is changed from its own form. A constraint keeps a single one marked. Seeded as __import__.quality_doc_process_map (“Mapa de processos”, the Drive title), without its link.

Read-only until “Edit”

The three models inherit ems.quality.edit.mode (models/quality/edit_mode.py): a non-stored edit_mode that always loads False (True for a record being created) and, through ems.quality.can.edit, can_edit (has_access('write'), non-stored, @api.depends_context('uid')). Every field of their forms is readonly="not edit_mode", and the header shows an Edit button (field widget ems_quality_edit_mode) only when can_edit. Pressing it sets edit_mode on the client; saving or discarding reloads the record, so it comes back read-only. Record access is unchanged: this is only about not presenting every field as editable by default.

Minutes: read-only for whoever may only read them

The minutes list (action_minute) opens on Mine or Awaiting my approval (same filter group, so ORed), Meeting minutes and Current course. Mine covers whoever writes the minute and whoever was convened to it, attendee or absentee: a meeting somebody missed, or one held by email they have not answered yet, is theirs too.

ems.minute inherits ems.quality.can.edit too, without the “Edit” step: a minute is written live, so whoever may write it gets it editable straight away. Whoever may only read it (an attendee or an absentee, who were both convened and get its draft; a department colleague: see rule_minute_teacher vs rule_minute_teacher_write in security/rules/quality.xml) gets it read-only. The form’s js_class="ems_minute_form" (static/src/js/backend/minute_form.js) adds an onRootLoaded hook that switches the record to readonly mode when can_edit is False, and back to edit when it is True, on every load (the pager moves between minutes the user may and may not write); its autosave skips a read-only record and must never take the cursor out of the text being written (issue #755): when only existing lines changed it saves with reload: false, so nothing is redrawn; when the changes add one2many lines (which need the reload for their ids) it remembers which text box had the focus (its position among the form’s text boxes) and the caret’s offset, and puts them back after the redraw. Every header action and the attendance kiosk buttons are also invisible="not can_edit or ...", since each of them writes the minute. The record rules stay the only real guarantee.

The three forms use js_class="ems_quality_form" (QualityFormRenderer in static/src/js/backend/quality_document_fields.js), which always opens them on their first tab, the record’s own document: Odoo otherwise restores the last tab opened on the same form, even for another record. Their embedded procedure and document lists use the field widget ems_quality_linked_rows (QualityLinkedRowsField, same file): while the form is read-only, clicking a row opens that record in its own form, with the parent kept in the breadcrumbs; while editing, a click edits the row in place.

There is no configuration menu: everyone with the Quality menu consults the structure under Documentation, and whoever may write changes it with Edit on the record itself. The document list is not editable in place, so every change goes through the form. Its Load links button (quality coordination and management) opens ems.quality.document.link.import, which fills url from a code,url file in one go, matching each code against documents, procedures and processes, and a line that is no code against the exact name of a document without one (the strategic documents and the process map; a name shared by several matches none and is reported).

The links point into the centre’s Drive, and several of those documents are shared by link: publishing them in this public repository would expose them. So url is not a data/custom/ CSV column; it is filled in from the interface, or loaded with the wizard from a file kept outside the repository.

The three models are seeded once and then frozen, like every data/custom/ record (res.company._ems_freeze_living_custom_data(), see ../shared/data_loading.md): the quality coordination keeps the structure from the interface, and no upgrade reverts those edits.

Why the seeded names are in Catalan

The process map, the procedures, the document registry, the minute types and the minute sections are seeded from data/custom/quality/*.csv with their Catalan names, taken verbatim from the centre’s own controlled documents. Those records are owned by __import__, and .po translation never reaches them: the exporter (TranslationModuleReader._export_translatable_records) only looks at ir_model_data rows whose module is a module being exported, and __import__ is not a module. The value written by the CSV — stored under the en_US key of the jsonb field — is therefore what every reader sees, whatever their language, so it has to be the wording the centre actually uses.

Module strings (field labels, menus, buttons, report headings, selection values) are unaffected: they stay English in the source and are translated through i18n/ca_ES.po and i18n/es_ES.po as usual.

ems.minute — lifecycle

Language. The title (name) and the scope (scope_name) are stored computes, so they are built in the centre language (res.company.ems_lang, through res.company._ems_centre_env(), see company.md) rather than in the language of whoever creates the minute; the PDF, the call and the codes (common.scope_code) use the same language.

A meeting minute goes through four states; an evidence record (a minute type of kind record) skips the meeting and goes straight from draft to approval.

stateDiagram-v2
    [*] --> draft: created
    draft --> meeting: Start the meeting
    meeting --> draft: Back to preparing the meeting
    meeting --> to_approve: Send for approval
    draft --> to_approve: Send for approval (evidence record)
    to_approve --> meeting: Back to the meeting
    to_approve --> draft: Back to draft (evidence record)
    to_approve --> approved: Approve
    approved --> to_approve: Undo the approval
    approved --> [*]
Change Method Who What else happens
(before sending for approval) Send the call action_send_call whoever can write it emails the convened; no change of state
(in draft) Delete action_delete (unlink) whoever can write it (rule_minute_teacher_unlink, draft only) its agenda, lines and agreements go with it, and its NFC session while still a draft; _unlink_only_draft refuses any other state, for every role
Start the meeting action_start_meeting whoever can write it the minute opens for writing; with the NFC tag, its kiosk can be opened
Back to preparing / to the meeting / to draft action_back_to_draft, action_back_to_meeting whoever can write it back to preparing is refused once its NFC session has been opened
Send for approval action_open_submit_dialog → ems.minute.submit.wizard.action_confirm → action_submit (an evidence record calls action_submit straight away) whoever can write it NFC attendance copied into the lists; the development composed from the items; Approve the minute task for the approver
(meeting or waiting for approval) Send the draft to the participants action_send_draft, also from the submit dialog’s Also send the draft to the participants whoever can write it emails everybody convened, whether they came or not: the attendees and absentees who have a work_email (one message, with a link to /report/pdf/ems.report_minute/<id>, the draft as it stands) and each guest with an email (a message of their own with the PDF attached, having no account); a note “Draft sent to N people”
Approve action_approve whoever gives the approval (can_approve) approval date set, PDF rendered and attached; approval task done; its agreements announced (tasks and notices); the approved minute emailed to everybody convened (_ems_send_approved(): the staff in one message with a link to the stored PDF, /web/content/<pdf_attachment_id>; each guest with an email, the PDF attached; a meeting held by email by its thread) and a note “Approved minute sent to N people”
(approved) Undo the approval action_reopen whoever gives the approval, whoever answers for the scope (_ems_approver_candidates) and whoever wrote it with their chain of command (redactor_scope_user_ids): can_reopen / _ems_user_may_reopen back to to_approve (written with sudo, since the record rules never let anybody write an approved minute); approval_date and pdf_attachment_id cleared, the previous PDF stays attached to the record; a note in its history; the approval task comes back. Approving again sets the new date and PDF and announces its agreements again: _ems_sync_tasks brings the tasks in line with what the minute now says, and _ems_queue_notice(once=True) skips a notice a user already had in the same words (compared as plain text), so only what changed is told

“Whoever can write it” is the write rule (rule_minute_teacher_write): the writer and their chain of command (redactor_scope_user_ids: a Seminar Chief above the teacher who writes it edits it even when a Department Chief above both approves it), the person named to approve it and their chain of command, and the holders of its approver post, while it is not approved, plus quality coordination and the administrator. The rules that depend on “whoever can write the minute” (its agreements, their follow-up, its NFC attendance session) use the same two chains. Approving is narrower (_ems_user_may_approve): the person named in Approved by or anybody above them in the chain of command, who stands in when they are away (approver_scope_user_ids, non-stored and searchable: that employee’s tutor_scope_user_ids, so their Department or Seminar Chief, Head or Deputy Head of Studies and the Director, never a chief of another branch); while nobody is named, a holder of the post in Approved by (post); plus the administrator (group_academic_admin, top of the pyramid) and the superuser. Never the writer just for having written it. The check runs in action_approve before anything is written, since approving then records the approving employee as Approved by (which differs from the person named only when the administrator approves on their behalf). Every change of state asks for confirmation (confirm= on its button).

Sending for approval records who did it and when (submitted_by_id, submission_date), cleared again when the minute goes back to the meeting or to draft. In the PDF, each signature cell carries, under the name, the stamp of its side once it has happened: “Sent for approval in EMS” (who sent it, when, the minute’s code) under the writer, “Approved in EMS” (who approved it, approval_date, the code) under the approver; until then the same room is left blank. The stamp is the shared QWeb template ems.report_validation_stamp (reports/shared/report_validation_stamp.xml), the same one the convalidation resolution prints; like there, it is EMS’s record of who did it, not a qualified electronic signature (issue #530).

Every page of the minute’s PDF names, under the company footer, the ISO 9001 controlled document it is printed on (“PE3.01.22 Model d’acta i de registre d’evidències (EMS) – Revisió: 02/11/2026”). The text is fixed in reports/minute_report.xml (ems_footer_note), verbatim and not translatable, so a new revision of that model means editing it there. Any report can do the same: ems_footer_note, set before calling web.external_layout, is printed by ems.external_layout_footer_note (reports/shared/report_layout_footer_note.xml), hooked under company.report_footer in each of Odoo’s seven layouts, since the company can pick any of them (issue #769).

Filing in Drive (issue #769). ems.signed.record keeps one copy of each record’s PDF in the shared drive folder of the setting res.company.minute_drive_folder_url (a folder link or its bare id, read by _ems_drive_folder_id(); nothing is filed while it is empty or google_ws_enabled is off). Its create(), and its write() whenever state is written, queue _ems_upload_to_drive (queue_job, identity_key ems_drive_upload_<model>_<id>, so several changes in a row file it once); the job renders the record as it stands, or takes the approval’s pdf_attachment_id once approved, and creates <code>.pdf in the folder or replaces the content of the file it already has (drive_file_id, drive_url, shown on the minute’s form), filing it again if that file was deleted in Drive (404). It locks the record’s row first (_gw_lock_for_creation), so two jobs of the same record never both create a file. unlink() queues _ems_drive_trash for the deleted records’ files (sent to the shared drive’s bin). Edits between two changes of state reach Drive at the next one, deliberately: the minute saves itself while being written, and an upload per autosave would be one render and one Drive call every few seconds. The client is google.workspace.mixin._gw_get_drive_service(), the same service account as the Directory integration with the drive scope; it acts as itself (no domain-wide delegation), so it only needs to be a member (Content manager) of the shared drive, and a service account has no storage of its own, which is why the folder must be in a shared drive (supportsAllDrives). google_ws_dry_run only logs. Built on Drive’s own API rather than a module: Odoo 18’s cloud_storage_google stores chatter attachments in a Google Cloud Storage bucket, not in Drive, and storage backends move every attachment, while this is one named file per record in a folder people browse.

Attendees and absentees (attendee_ids, absentee_ids) exclude each other: _check_attendee_not_absent refuses anybody in both, and the form shows both with ems_exclusive_tags (static/src/js/backend/exclusive_tags_field.js, option exclusive_with naming the sibling field), a many2many_tags that takes whoever is added to one off the other and lets a tag be dragged between them.

People on leave (issue #776). With attendance written by hand, _ems_sync_leaves() moves to absentee_ids every attendee with an absence overlapping the meeting (start_datetime + duration), using the attendance session’s ems.meeting.presence._ems_on_leave() (the guard duty board’s absences, approved or requested), and appends “: Has an absence" to `absence_notes` (`_ems_leave_note()`, centre language), keeping whatever the writer typed. `on_leave_ids` records whom EMS moved: somebody the writer puts back among the attendees is not moved again, and somebody whose absence is gone goes back to the attendees (if still among the absentees) and loses the note. It runs in `create()` and on `write()` of `attendance_mode`, `start_datetime`, `duration`, `attendee_ids` or `state` (so moving to the meeting looks again), only for `draft`/`meeting` minutes of kind `meeting`, guarded by the `ems_leave_sync` context. `_ems_preload_attendees()` clears `on_leave_ids` and takes the new attendees off the absentees, so a new scope is looked at from scratch. With the NFC tag, the session does it (see `meeting_presence.md`); its lines are created from the attendees plus `on_leave_ids`, so switching from by hand to the tag loses nobody.

People from outside EMS (ems.minute.guest, the minute’s guest_ids): a student’s family, a teacher from another school, a speaker. No employee record and no account: first name, surname, an optional email (validated with email_normalize), an optional organisation or relationship, and Present (ticked by default; unticked for somebody invited who did not come). They are written by hand whatever the attendance mode (they have no tag), count in attendee_count when present, and the PDF lists them with the attendees or the absentees by name and organisation. Their email is never printed. The call (action_send_call) goes to the staff as a single message with every recipient in view, so a guest is only sent it when Send them the call (send_call, which needs an email) is ticked, and then in a message of their own (_ems_call_mail), without the backend link to the previous minute, which they could not open; they count in call_recipient_count. Access is the same as the minute’s other line models (ACL, no rule of their own). The form keeps the table hidden behind a switch (show_guests, non-stored, computed from guest_ids and editable) until somebody is added, so the attendance block stays short.

Annexes (issue #803): annex_attachment_ids, files uploaded from the writer’s computer (ir.attachment, many2many_binary widget, the native upload), in the form’s Annexes block and listed in the PDF. A file uploaded while the minute is still unsaved has no res_id, so ir.attachment only lets its uploader read it; _ems_link_annex_files() (from create() and from write() of annex_attachment_ids) gives it the minute’s res_model/res_id, so it follows the minute’s own access (whoever reads the minute downloads it, whoever writes it removes it). It only takes over files the person saving uploaded (or any, under superuser). The list is read-only once approved.

Meetings held by email (issue #822)

A meeting held by email is a modality of any meeting minute (modality = 'email', “By email”), not a type of its own: the minute keeps its type, scope and numbering, so it follows on from the earlier minutes of the same scope (previous minute, carried agreements and pending topics) and shows in the default “Meeting minutes” filter. The minute’s own chatter is the thread. It reuses the meeting’s states; what changes is how it is held. Only a type with a section of kind requests (the centre’s “Precs i preguntes”, __import__.minute_section_requests) can be held by email (_check_email_modality): that is where the answers are written.

sequenceDiagram
    participant W as Writer
    participant M as Minute (chatter)
    participant P as Participants
    W->>M: Open the thread (action_start_meeting)
    M->>P: Opening email (agenda, reply_deadline), Reply-To = catchall
    P->>M: Answers by email (incoming mail server)
    Note over M: _ems_file_intervention: under "Precs i preguntes", author to the attendees
    P->>M: Intervention on an item (wizard in EMS)
    Note over M: under the item's notes, posted to the thread
    M->>P: Every message, to every follower
    W->>M: Send for approval + draft (by the thread)
    P->>M: Answers to the draft (stay in the chatter)

Filing runs with sudo, since the incoming email is processed by the mail gateway. Cost per message: one indexed employee lookup and one write of the section (or item), whatever the size of the thread; unsubscribing on a list change is one query on the minute’s followers. The production circuit (catchall, incoming mail server) is the one described in chatter_email_answers.md; on a development machine nothing is fetched, so this is tested with message_process() (tests/test_quality_minute_thread.py, tests/test_quality_minute_thread_tour.py). The section kind requests was set on existing installations by migrations/18.0.0.50.0/post-migrate.py.

Who can start each kind of minute

ems.minute.type declares it with two fields, set per type in Meetings → Configuration → Minute types: starter_role_ids (the posts whose holders can start it for any scope) and starter_scope (also the people of its own scope, only for that scope). With neither set, anybody can.

Scope Its people (_ems_scope_records())
department the department’s Department and Seminar Chiefs and those above them (manager_id/seminar_chief_id.tutor_scope_user_ids)
teaching_team the group’s tutor and those above them (tutor_id.tutor_scope_user_ids), and whoever teaches the group (ems.teaching)
workgroup its members

Academic and quality administrators can always start any kind (_ems_starts_anywhere()).

Seeded values (data/custom/quality/ems.minute.type.csv): generic open to all; department and teaching team by their scope; claustre by Director, Head of Studies, Deputy Head of Studies and Secretary; improvement team constitution and closing by the quality coordinator, its meetings also by the team’s members.

ems.quality.action — agreements and improvement actions

Field Type Notes
code Char, readonly Issued by sequence — see Numbering
name Char, required “Action to take” / “Agreement”
description Html  
type Selection, required agreement, immediate, repair, corrective, preventive, improvement, change
responsible_role_id Many2one → ems.role  
responsible_employee_ids Many2many → hr.employee The centre’s real data holds values like “<name> + volunteers”, so several people must be expressible alongside the post
deadline_date Date  
deadline_text Char Real deadlines are often prose (“by the final meeting of the year”); both are kept
resources Char  
completion_criteria / efficacy_criteria Text “When will it be finished” / “How will efficacy be measured”
department_id / workgroup_id / group_id / is_centre   The scope: drives the sequence, the filters and the record rules
course_id Many2one → ems.course, required  
followup_ids One2many  
state Selection, computed, stored See State
is_late Boolean, computed, stored Past its deadline and not closed

Phase 2 onwards adds the origin (minute_id, issue_id, objective_id, audit_id, review_id), of which exactly one is set.

ems.quality.followup

Field Type Notes
date Date, required  
state Selection, required The five stages below
description Text, required What happened
author_employee_id Many2one → hr.employee Defaults to the current user’s employee
action_id Many2one Phase 3 adds issue_id, with exactly one of the two set

State

no owner and no deadline yet     → New (pending)
planned but no follow-up yet     → Analysed (planning)
otherwise                        → the state of the latest follow-up entry

The five stages, matching the centre’s own vocabulary: new New (pending), analysed Analysed (planning), in_progress In progress (implementation), review Review (measuring efficacy), closed Closed. Open means anything not closed — there is no separate open flag, and no editable state field: moving forward requires a follow-up entry, which is what keeps the reason on record.

An agreement can be closed at any moment, including in the minute that takes it (a decision nobody has to carry out): Done on its card in the minute (is_closed_in_minute) adds a closed follow-up entry dated and signed as the minute (_ems_sync_minute_closure, sudo, the same reasoning as the review of an agreement in a later minute), kept in minute_followup_id so unticking it removes that entry again. The minute’s PDF prints “Done” in its deadline column, and it is not carried into the next minute. The text EMS writes into a follow-up entry on its own (an agreement done or reviewed in a minute with nothing written about it), and the internal note every entry posts on the agreement, are stored, so they are in the centre’s language (res.company._ems_centre_env()), whatever language the writer works in.

Numbering

ir.sequence, one per (scope, element type, course), resolved or created on demand by ems.quality.action._ems_sequence_for_scope(). A hand-rolled max + 1 is not used: it loses to concurrent writes when two people approve records at the same time.

Element Code Counter
Agreement or action ACORD-INF-2026-27-012 per scope and course
Records (phase 3) NC-2026-27-007 per centre and course

The academic year segment comes from ems.course.short_code, a stored computed field (2026-27) that is the single source of that string. Note ir.sequence.number_next_actual is live application state and must never appear in a data file.


Access control

Quality coordination is ems.group_quality_admin and the quality committee is ems.group_quality (“Committee member”, implied by coordination; see below for how it is kept in step with the committee workgroup).

Model Teacher Dept. head Head of studies Secretariat Quality coord. Committee Management
ems.quality.process — R R R R+W R R+W
ems.quality.procedure — R R R R+W R R+W
ems.quality.document R R+W R R R+W R R+W
ems.quality.action R own scopes, W content of their actions out of a minute R own scopes, W content in their line R+W content in their line R own scopes R+W all R+W all R+W content in their line
ems.quality.followup R as its action, W when responsible R as its action, W when responsible or in their line R as its action, W in their line R as its action R+W all R+W all R as its action, W in their line
ems.minute R own scopes, W own R+W own, R their departments R their line R own scopes, W own R all, W R all R their line

ems.minute (security/rules/quality.xml): “own scopes” are the minutes of the user’s departments, workgroups and staff meetings, the ones they write, approve or attended, and, along the chain of command, those of every department whose Department or Seminar Chief they are above (the department’s chief’s tutor_scope_user_ids: the chief, every chief above them through parent_id, which is how the Deputy Head of Studies for VET reaches the VET departments and the Head of Studies the ESO/BTX ones, and the Director) and of every group whose tutor they are above. The secretariat goes by the same rule (a user in no rule group of the model would see every record). Only the committee, quality coordination and the administrator see every minute. Writing stays with whoever writes or approves the minute, while it is not approved.

ems.quality.action and ems.quality.followup (same file; the follow-up uses its action’s domains through action_id) go by the same chain of command, with three ways of being in an agreement:

Reading also reaches whoever reads a minute of the same scope (its department, workgroup or group, a staff meeting; the minute’s attendees, writer and approver). The committee, quality coordination and the administrator see and write them all. The responsible people are subscribed as followers (_ems_subscribe_people, sudo) and hear of the agreement through their daily summary (see “Telling the people concerned” below). The scope is one at a time: is_centre empties department, group and workgroup in the form, and the other way round. The form uses ems_can_edit_form (static/src/js/backend/can_edit_form.js, also the base of the minute’s form controller) to open read-only for whoever may not write it.

Escalation follows the real hierarchy, not flat group membership: a department head sees their own department’s scope, and above them their own head of studies and management — not every holder of those posts. Reuse the tutor_scope_user_ids / find_head_of_studies() patterns rather than an ir.rule with domain_force=[].

The Quality root menu is restricted to the quality committee (ems.group_quality, “Committee member”), quality coordination (ems.group_quality_admin, which implies it) and management (ems.group_director); the head of studies and the secretariat reach minutes and agreements from the Meetings menu. The same committee group opens the Surveys section (LimeSurvey), where each member reads every survey but only edits the ones they created (security/rules/communications.xml). Only quality coordination maintains the structure and loads its links.

A committee member is given the group either by hand (the Quality selector of the user form) or by being a member of the committee workgroup, ems.quality (“Comissió de Qualitat”, data/main/ems.workgroup.xml; no flag on the workgroup model). Its data file is noupdate, so the centre can rename it from the app and no upgrade puts the original name back. ems.workgroup._ems_sync_quality_committee() adds the group to whoever joins it and takes it from whoever leaves it, on every change of its employee_ids and on its unlink, following the role sync’s rule (hr.employee._sync_security_groups): someone given the group by hand without being a member is never touched, and quality coordination keeps it on leaving. data/main/sync_quality_committee.xml runs it (add-only) on every install and upgrade, for an installation whose committee already had members. Only group_academic_admin may write workgroups. A change to an employee’s user is not followed until the workgroup changes again.


Telling the people concerned (issue #753)

Quality never emails the staff on its own (the meeting call aside, which has a date and goes to people outside EMS too): everything reaches them through their daily summary, as a task (mail.activity, scheduled quietly with mail_activity_quick_update) or an informative notice (ems.info_notice). Only the people who answer for an agreement in person are told: ems.quality.action._ems_responsible_users(), its responsible people plus the holders of its responsible post. Never the people involved, nor the chain of command, who oversee agreements from their screen.

flowchart TD
    A[Agreement created / responsible people or deadline changed] --> B{_ems_is_announced?<br/>no minute, or minute approved}
    B -- no --> W[Wait for the minute's approval]
    B -- yes --> C[_ems_sync_tasks]
    W --> M[ems.minute write state=approved<br/>_ems_announce_agreements]
    M --> C
    M --> N1[Notice 'done_in_meeting'<br/>agreements with minute_followup_id]
    M --> N2[Notice 'followup'<br/>each review's follow-up entry]
    C --> T[Task 'Carry out the agreement' per responsible user,<br/>due on deadline or today; done when closed;<br/>removed for who stops being responsible]
    C --> N3[Notice 'assigned' for new users,<br/>only when the deadline is later than today]
    F[Follow-up entry added by hand] --> NOTE[Internal note on the agreement: mt_note, notifies nobody]
    F --> N4[Notice 'followup' to responsible users<br/>except its writer, if announced]
    F --> C2[_ems_sync_tasks announce=False]
What When Who How
Carry out the agreement (ems.mail_activity_quality_agreement) agreement announced and open each responsible user task due on deadline_date, today without one; moved with the deadline; action_feedback once state is closed; unlinked for a user who stops being responsible
“You are responsible for this agreement” a user gets the task and the deadline is later than today (the summary only lists a task once due) the new responsible users, except whoever made the change notice
A follow-up entry created by hand on an announced agreement responsible users except its writer notice; the entry is also posted on the agreement as an internal note (mail.mt_note)
A follow-up entry written by a minute (review of an agreement, “Done” closing entry) the minute is approved, with its final wording responsible users except the approver notice (ems_quality_minute_entry context keeps it from being queued when the minute writes it)
“Agreed and done in the meeting” the minute that took and closed it is approved responsible users except the approver notice, no task
Approve the minute (ems.mail_activity_minute_approval) the minute is to_approve approver_employee_id’s user, or the holders of approver_role_id when nobody is named task due the day it is sent; done when approved; removed when it goes back to the meeting or to draft or another approver is named (ems.minute._ems_sync_approval_task, from write)

The notice (ems.quality_agreement_notice, mails/quality/agreement_notice.xml) is rendered in the recipient’s language and says what happened plus the agreement’s meeting, scope, responsible people, deadline and state; the summary heads it with the agreement’s code and content. An agreement taken in a minute is only announced once the minute is approved, since what was agreed and who answers for it may still change until then.

Upgrade (migrations/18.0.0.46.0/post-migrate.py): the people involved who are not also responsible (nor the agreement’s creator) are unsubscribed from the agreements they followed. No task is created for agreements that already existed: they are created as their responsible people or deadline next change.

Carrying pending topics over (issue #755)

_ems_preload_previous (from the scope onchange and from create when no previous minute is set) copies the previous minute’s pending topics not dealt with, each once: none this minute already has, and no repetition the previous minute may hold. The form force-saves the readonly fields it fills (previous_minute_id, followed_agreement_ids, carried_from_minute_id): without it the web client never sent them, create found no previous minute and carried the topics a second time, and every following minute doubled them again. The upgrade (migrations/18.0.0.46.0/post-migrate.py) removes the repetitions from the minutes not approved yet; an approved minute is a closed record and keeps them, but carries each topic only once.