← Back to Pull requests

[19.0][REF] base_tier_validation: rewrite tier_review_widget collapse with native <details> #44

Closed
unknown closed this pull request without merging on Nov 16, 2026 15:21 UTC
View on GitHub
unknown unknown commented on May 14, 2026 16:16 UTC
Author

Summary

Replace the OWL-driven panel/card collapse machinery in the embedded Reviews widget with the native HTML5 <details> / <summary> element. Browser handles open/close state, keyboard accessibility, and the disclosure triangle; no JavaScript needed.

What goes away

  • onToggleCollapse handler (~13 lines walking ev.currentTarget.closest(".panel-heading") then toggling style.display manually).

  • useState import and this.state.collapse boolean.

  • <a class="o_info_btn" data-toggle="..." t-on-click="..."> shim and the explicit <div id="collapse1" class="collapse"> wrapper.

  • Bootstrap 3 leftover SCSS (.panel-group, .panel-heading, .panel-title, .panel-body all dropped — none of these classes exist in Bootstrap 5 which Odoo 19 ships).
  • What replaces it

  • <details class="o_tier_review_details" open="open"><summary>Reviews</summary><div class="o_tier_review_body">...</div></details>. The open attribute defaults to expanded, matching the previous default.

  • A small SCSS layer re-skinning the disclosure marker so it looks like Odoo's FontAwesome caret: summary::before { content: "\f0d7" }, rotates -90° when the <details> is closed. summary::-webkit-details-marker { display: none } so we don't render two triangles.
  • Net effect

    | | Before | After |
    |---|---:|---:|
    | JS | ~30 LOC | 13 LOC |
    | SCSS | 12 selectors (Bootstrap 3 + custom) | 5 selectors (Odoo namespaced) |
    | Accessibility | <a href="#"> shim, click-only | Native <details>, Space/Enter, screen-reader-aware |

    Same UX (click Reviews heading to toggle, defaults to open).

    Table

    Horizontal space is scarce in this table, so:

  • The sequence column is headed # (2rem) instead of Sequence, and the text columns are left-aligned.

  • The Comment column only shows on documents where at least one review has a comment.

  • The status is a badge, with the same classes as Odoo's badge widget: Pending in warning, Approved in success, Rejected in danger, anything else (Waiting, Cancelled, statuses added by other modules such as Forwarded) in the neutral default. Pending, the status that asks someone to act, used to be the only row without any styling.

  • Requested by is shown once next to the Reviews heading ("Reviews · requested by …") when all reviews have the same requester, which is the usual case: a validation request creates them all at once. Only the forward module adds reviews requested by someone else; then the column stays.
  • Forward module

    base_tier_validation_forward extends this table with an xpath on table-condensed, which is now table-sm. The xpath no longer matched, and the web client refused to render documents under review (Element ... cannot be located). The xpath no longer depends on the table's classes.

    Tests

    Hoot tests mount the widget on mock data and check the Comment and Requested by columns, the requester next to the heading and the status badges. In base_tier_validation_forward, a test checks that a forwarded review is highlighted and that the requesters then stay in a column. A Python test in each module runs them, so OCA CI covers them.

    Test plan

  • Open a validated document (e.g. account.move under tier validation). The Reviews section is open by default with the caret pointing down.

  • Click the Reviews heading: panel collapses, caret rotates to point right.

  • Click again: expands back.

  • Tab-focus the summary and press Space or Enter: same toggle. (Keyboard accessibility was not available with the previous <a> shim.)

  • Open a document where no review has a comment: no Comment column. Add a comment to one review: the column appears.

  • With base_tier_validation_forward installed, forward a review: the document opens and the row is highlighted.

  • Check the status badges: yellow for Pending, grey for Waiting, green once approved, red once rejected.

  • On a document after one validation request: "requested by …" next to the heading, no Requested by column. Forward a review: the column comes back.
  • Diff: 508 lines (+381 / -127) across 6 files Reviewer: bofiltd Review duration: 267784m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.48) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.48 · 508 lines diff across 6 files
    0.48
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.373
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #44"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 47.6% (MEDIUM) · Higher = larger blast radius
    47.6%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 18.8% · Safe to merge
    18.8%