[IMP] base_tier_validation: clearer, self-checking tier definitions#48
Open
bosd wants to merge 1 commit into
Open
[IMP] base_tier_validation: clearer, self-checking tier definitions#48bosd wants to merge 1 commit into
bosd wants to merge 1 commit into
Conversation
Contributor
|
Hi @LoisRForgeFlow, |
Open
5 tasks
cd6630a to
07aade2
Compare
Authoring a tier definition is hard for non-technical users: a raw domain, technical model/field names, and opaque sequence/approve knobs with no indication of how rules combine -- and the only way to verify a rule is the full live request/approve loop. - Add a computed plain-language Summary (form banner + list column) describing in one sentence which documents the rule covers and who must validate it. - Add inline help to the model, filter, reviewer-field, sequence and approval fields, with a concrete domain example. - Open the Tier Definition list grouped by document type in sequence order, so the full ordered tier chain per model is visible at a glance (and add _order = "sequence, id"). - Block a malformed filter at save time with a clear error (the engine already literal_eval's it at request time), and warn -- without blocking -- when a rule has no filter or no reviewer set yet. The reviewer check is an onchange, not a constraint, so programmatic / bridge-module creation of not-yet-complete definitions still works.
07aade2 to
6b431b2
Compare
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.
Why
Creating a
tier.definitionis hard for non-technical users: a rawOdoo domain (
[('amount_total','>',1000)]), technical model/fieldnames, and three interacting knobs (
sequence,approve_sequence,approve_sequence_bypass) with nothing showing how multiple rulescombine into an ordered chain. There is also no human-readable summary
anywhere, and a bad domain only blows up later at
request_validation.What
tier_summary, computed): a one-sentencedescription of the rule shown as an info banner on the form and as a
list column, e.g. "Tier 30 — Journal Entry where amount_total >
1000: validated by Specific user John Doe (in sequence)". Domain
rendering is best-effort and never raises (falls back to the raw
string).
approval fields, including a concrete domain example.
by document type, in sequence order (
_order = "sequence, id"), sothe full ordered tier chain per model is visible at a glance.
clear
ValidationError(consistent with the existingliteral_evalin
evaluate_tier). Non-blocking onchange warnings fire when a rulehas no filter, or no reviewer set for the chosen Validated by.
Design note
The "reviewer not set" check is an onchange warning, not a
constraint, on purpose: definitions are legitimately created
incomplete -- programmatically and by bridge modules (e.g.
account_move_tier_validationcreates a definition then sets thereviewer later). A hard constraint would regress those flows and
existing tests. Only the domain-parse check is hard, because the
runtime already requires the domain to be
literal_eval-able.Tests
test_36–test_39: summary is human-readable (names model, condition,reviewer); malformed domain blocked at create; empty-domain and
missing-reviewer onchanges return warnings.
Scope
19.0 only. No
__manifest__.pybump (ocabot bumps on merge).