Skip to content

fix(spp_user_roles,spp_area): follow base_user_role rename of role_ids to user_role_ids - #508

Merged
gonzalesedwin1123 merged 2 commits into
19.0from
fix/base-user-role-user-role-ids-xpath
Sep 7, 2026
Merged

fix(spp_user_roles,spp_area): follow base_user_role rename of role_ids to user_role_ids#508
gonzalesedwin1123 merged 2 commits into
19.0from
fix/base-user-role-user-role-ids-xpath

Conversation

@gonzalesedwin1123

Copy link
Copy Markdown
Member

Problem

Every CI build that rebuilds the OCA download layer has failed since Friday 2026-09-04:

odoo.tools.convert.ParseError: while parsing /mnt/extra-addons/openspp/spp_user_roles/views/user.xml:17
Element '<xpath expr="//field[@name='role_ids']">' cannot be located in parent view

OCA/server-backend #428 (merged 2026-09-04 14:18Z) renamed the computed res.users.role_ids One2many to user_role_ids in base_user_role — model, compute method and the form/search/list views. Two of our view inheritances anchor their xpath on the old name:

  • spp_user_roles/views/user.xml — replaces //field[@name='role_ids'] in base_user_role.view_res_users_tree_inherit with our stored role_ids_stored. This is the error above; because spp_base_common depends on spp_user_roles, it takes nearly every module down with it.
  • spp_area/views/user.xml — inserts the center-areas group before //field[@name='role_ids'] in base_user_role.view_res_users_form_inherit. Fails the same way once the first one is fixed.

This is not caused by any OpenSPP2 change. 19.0 at df808ef (#478) passed CI Friday 06:57Z, before the OCA merge; the scheduled Full Test Suite on the same commit failed Saturday with this error. PRs that passed since (#479, #397) did so only because CI served the pre-rename OCA code from the GitHub Actions layer cache. Anything that invalidates that layer — a Dockerfile change (#507) or a requirements.txt change (dependabot #502#506) — downloads the current OCA head and fails.

Change

  • Both xpaths anchor on user_role_ids.
  • spp_user_roles 19.0.2.0.1 → 19.0.2.0.2, spp_area 19.0.2.0.2 → 19.0.2.0.3, with readme/HISTORY.md fragments.
  • Two comments that named the upstream field updated to match.

No data migration: the renamed field is a non-stored compute. Our role_ids_stored field and the set_groups_from_roles override are untouched; the OCA head still exposes role_line_ids, _get_enabled_roles and set_groups_from_roles with the same signatures.

Compatibility note

After this lands, OpenSPP requires base_user_role at or after OCA/server-backend cc051ce6. Images are built from the 19.0 branch head of that repo, so any fresh build gets it. A deployment that pinned an older server-backend checkout would need to move it forward. #507 would allow pinning explicitly; the pre-rename commit is 9513a363 if anyone needs to hold back temporarily.

Follow-up (not in this PR)

role_ids_stored exists to work around the list-view display bug that OCA #428 fixes properly (the native role_ids Many2many was shadowing the OCA One2many). The workaround field may now be redundant; worth a separate look rather than widening this fix.

Verification

  • Both XML files parse; prettier and ruff pass on the changed files.
  • CI is the real check here, and it is only meaningful if the build step actually rebuilds the OCA download layer rather than serving the cached pre-rename code. I will confirm from the build log which one happened.
  • README.rst / index.html are intentionally not regenerated locally; CI's pinned generator is the authority and its diff will be applied verbatim.

…s to user_role_ids

OCA/server-backend #428 (merged 2026-09-04) renamed the computed
res.users.role_ids One2many to user_role_ids, in the model and in the
form, search and list views of base_user_role. Two of our view
inheritances anchored their xpath on the old name, so spp_user_roles
failed to install against the current 19.0 head of base_user_role
("Element cannot be located in parent view") and took every module that
depends on it down with it.

Rename both anchors to user_role_ids and bump spp_user_roles to
19.0.2.0.2 and spp_area to 19.0.2.0.3.
@codecov

codecov Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.92%. Comparing base (df808ef) to head (21c6837).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             19.0     #508      +/-   ##
==========================================
+ Coverage   76.88%   76.92%   +0.04%     
==========================================
  Files         703      735      +32     
  Lines       45732    47935    +2203     
==========================================
+ Hits        35160    36874    +1714     
- Misses      10572    11061     +489     
Flag Coverage Δ
spp_analytics 93.25% <ø> (ø)
spp_api_v2_change_request 73.37% <ø> (ø)
spp_api_v2_cycles 71.03% <ø> (ø)
spp_api_v2_data 77.77% <ø> (ø)
spp_api_v2_entitlements 70.23% <ø> (ø)
spp_api_v2_gis 74.60% <ø> (ø)
spp_api_v2_programs 92.22% <ø> (ø)
spp_api_v2_service_points 71.03% <ø> (ø)
spp_api_v2_simulation 71.19% <ø> (ø)
spp_approval 50.85% <ø> (ø)
spp_area 80.16% <ø> (?)
spp_area_hdx 81.60% <ø> (?)
spp_audit 72.13% <ø> (?)
spp_base_common 91.07% <ø> (ø)
spp_case_cel 89.50% <ø> (ø)
spp_programs 67.58% <ø> (ø)
spp_registry 88.94% <ø> (-0.03%) ⬇️
spp_security 69.56% <ø> (ø)
spp_user_roles 91.93% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
spp_user_roles/models/user.py 93.54% <ø> (ø)

... and 32 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gonzalesedwin1123
gonzalesedwin1123 merged commit c4329e2 into 19.0 Sep 7, 2026
39 of 58 checks passed
@gonzalesedwin1123
gonzalesedwin1123 deleted the fix/base-user-role-user-role-ids-xpath branch September 7, 2026 10:56
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