[19.0][IMP] base_tier_validation: validation progress indicator#35
Open
bosd wants to merge 1 commit into
Open
Conversation
Make it possible to tell at a glance how close a document under validation is to being fully approved. Server-side: - New `validation_progress` Integer (0-100) on the `tier.validation` abstract mixin, computed as `approved_reviews / total_reviews * 100`. Returns 0 when there are no reviews. The computation reuses `_validated_states()` so subclasses that override the approved state semantics keep working. Client-side (embedded reviews widget): - Render a Bootstrap progress bar in the widget header next to the "Reviews" collapse title. The percentage is computed live in JS from the already-embedded review_ids data (no extra RPC), via a new `getValidationProgress()` helper on the OWL component. - SCSS scopes the new layout under `.o_tier_validation_progress_header` so the title + bar sit on one line with a sensible max width. The server-side field is what bridge modules will use to add a `widget="progressbar"` column to their list views (account.move, sale.order, ...). That work lands as separate follow-up PRs per bridge. Test: create two tier definitions, request validation, validate one tier (expect 50%), validate the other (expect 100%).
Contributor
|
Hi @LoisRForgeFlow, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Make it possible to tell at a glance how close a document under validation is to being fully approved.
Server-side
validation_progressInteger (0..100)on thetier.validationabstract mixin. Computed asapproved_reviews / total_reviews * 100, rounded to int. Returns0when there are no reviews. Reuses_validated_states()so subclasses that override approved-state semantics keep working.Client-side (embedded reviews widget)
review_idsdata, via a newgetValidationProgress()helper on the OWL component — no extra RPC..o_tier_validation_progress_headerso title + bar sit on one row with a sensible max width.Why both server-side field and JS computation?
widget="progressbar". Those follow up as separate per-bridge PRs.Test plan
test_validation_progress: create two tier definitions, request validation (expect 0%), validate one tier (expect 50%), validate the other (expect 100%).Heads-up on overlap
This PR touches
static/src/components/tier_review_widget/tier_review_widget.xmland.scss, which #23 also modifies (Bootstrap 3 -> 5 class rename). Whichever lands first wins; the other will need a trivial conflict resolution on class names (panel-heading->card-header). The progressbar additions are class-agnostic and survive either way.Follow-up PRs
widget="progressbar"column onaccount_move_tier_validation,sale_order_tier_validation, ...