Skip to content

[6788][ADD] maintenance_request_done_readonly - #105

Open
smorita7749 wants to merge 2 commits into
18.0from
6788-add-maintenance_request_done_readonly
Open

[6788][ADD] maintenance_request_done_readonly#105
smorita7749 wants to merge 2 commits into
18.0from
6788-add-maintenance_request_done_readonly

Conversation

@smorita7749

@smorita7749 smorita7749 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

@smorita7749

Copy link
Copy Markdown
Contributor Author

Pushed bc20921b3 to 6788-add-maintenance_request_done_readonly, reflecting the current state of the upstream PR OCA/maintenance#578 (module now identical to that branch).

What changed:

  • Configuration: dropped the res.config.settings UI (models/res_config_settings.py, views/res_config_settings_views.xml) in favour of editing the maintenance_request_done_readonly.editable_fields system parameter directly (created on install via data/ir_config_parameter.xml).
  • Access: added a dedicated group Maintenance: Edit Completed Requests (security/res_groups.xml), implied by maintenance.group_equipment_manager. The write lock now checks that group instead of the equipment manager group, so the permission can be granted without making the user a maintenance manager.
  • write(): the always-writable set is reduced to message_main_attachment_id plus the parameter-configured fields, the mnt_done_bypass_lock check moved first, and the code was simplified (walrus for the locked records, plain super()).
  • Tests: assert that managers imply the new group, and that a non-manager user holding the group can edit a completed request.
  • Docs (readme/DESCRIPTION.md, README.rst, static/description/index.html) and the manifest summary updated to the new behaviour.
 maintenance_request_done_readonly/README.rst       | 13 +++--
 maintenance_request_done_readonly/__manifest__.py  |  5 +-
 .../data/ir_config_parameter.xml                   |  7 +++
 .../models/__init__.py                             |  1 -
 .../models/maintenance_request.py                  | 67 +++++++++-------------
 .../models/res_config_settings.py                  | 38 ------------
 .../readme/DESCRIPTION.md                          | 12 ++--
 .../security/res_groups.xml                        | 18 ++++++
 .../static/description/index.html                  | 13 +++--
 .../test_maintenance_request_done_readonly.py      | 22 +++++++
 .../views/res_config_settings_views.xml            | 26 ---------
 11 files changed, 104 insertions(+), 118 deletions(-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant