Base Tier Validation
base_tier_validation · OCA/tier-validation
OCA/server-tools 9.0–10.0 → OCA/server-ux 11.0–18.0 → OCA/tier-validation 19.0
-
Security25/25No findings
-
Activity25/25Human commit this month
-
Required by25/2514 modules depend on it
-
Maturity25/25In 11 Odoo series since 9.0
Heuristic over the facts below, not an audit · How it's computed
Description
Validating some operations is a common need across different areas in a company and sometimes it also involves several people and stages in the process. With this module you will be able to define your custom validation workflows for any Odoo document.
This module does not provide a functionality by itself but an abstract model to implement a validation process based on tiers on other models (e.g. purchase orders, sales orders, budgets, expenses...).
Note: To be able to use this module in a new model you will need some development.
See purchase_tier_validation as an example of implementation.
Additionally, if your state field is a (stored) computed field, you need to
set _tier_validation_state_field_is_computed to True in your model Python
file, and you will want to add the dependent fields of the compute method
in _get_after_validation_exceptions and _get_under_validation_exceptions.
Dependencies
- Odoo dependencies
- Python dependencies
- None
- System dependencies
- None
- Required by
- account_move_tier_validation, account_payment_batch_oca_tier_validation, base_tier_validation_board, base_tier_validation_confirm_auth, base_tier_validation_correction, base_tier_validation_formula, base_tier_validation_forward, base_tier_validation_server_action, hr_expense_tier_validation, partner_tier_validation, purchase_request_tier_validation, purchase_tier_validation, sale_tier_validation, stock_picking_tier_validation
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
Views touched 11
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
tier_definition_view_form |
tier.definition.form | tier.definition | form | New |
tier_definition_view_search |
tier.definition.search | tier.definition | search | New |
tier_definition_view_tree |
tier.definition.list | tier.definition | list | New |
tier_review_view_tree |
tier.review.list | tier.review | list | New |
tier_validation_buttons |
tier_validation_buttons | ir.ui.view | qweb | New |
tier_validation_exception_form |
tier.validation.exception.form | tier.validation.exception | form | New |
tier_validation_exception_search |
tier.validation.exception.search | tier.validation.exception | search | New |
tier_validation_exception_tree |
tier.validation.exception.list | tier.validation.exception | list | New |
tier_validation_label |
tier_validation_label | ir.ui.view | qweb | New |
tier_validation_reviews |
tier_validation_reviews | ir.ui.view | qweb | New |
view_comment_wizard |
Comment Wizard | comment.wizard | form | New |
HTTP endpoints 0
No HTTP endpoints found for this module.
Models touched 6
-
commentCharrequired=True -
res_idInteger -
res_modelChar -
review_idsMany2many → tier.reviewcomodel_name='tier.review' -
validate_rejectChar
-
add_comment(self)
-
review_idsMany2many → tier.reviewcomodel_name='tier.review'copy=Falsestring='Reviews'
-
review_user_count(self)@api.modelCounts driving the tier-review systray dropdown. Each returned dict represents one model that has reviews touching the current user and reports three buckets so the dropdown can mirror Odoo's activity systray layout: - ``late_count`` -- reviews pending for longer than the configured *late* threshold (``base_tier_validation.late_after_days``, default ``7``). The reviewer should prioritise these. - ``pending_count`` -- pending reviews within the threshold. Standard work the reviewer can act on today. - ``future_count`` -- waiting reviews where the current user is assigned as reviewer but the sequence has not yet promoted the review to pending. "What is incoming for me". Records already counted as late or pending are left out. The per-bucket record ids are returned alongside the counts so clicking a bucket in the systray opens exactly those records. -
tier_review_dashboard_action(self)@api.modelOptional hook returning the action a downstream module wants the systray's "Show all reviews" footer link to open. Default is ``False`` so no link is rendered. ``base_tier_validation_board`` (and any other dashboard module) overrides this to point at its global review dashboard, matching the pattern of Odoo's "View all activities" footer in the activity systray.
-
activeBooleandefault=True -
allow_write_for_reviewerBooleandefault=Falsestring='Allow Write For Reviewers' -
approve_sequenceBooleandefault=Falsehelp='Approval order by the specified sequence number'string='Approve by sequence' -
approve_sequence_bypassBooleanhelp='Bypassed (auto validated), if previous tier was validated by same reviewer' -
comment_approve_defaultCharhelp='Default comment prefilled when approval comments are enabled.'string='Approve Comment' -
company_idMany2one → res.companycomodel_name='res.company'default=<expr> -
definition_domainChar -
definition_typeSelectiondefault='domain'selection=[('domain', 'Domain')]string='Definition' -
exclude_requesterBooleandefault=Falsehelp="When set, the user who requested the validation is removed from this tier's reviewer pool. Anyone else in the configured group can validate -- except the requester themselves. Without this flag, a requester who happens to be in the same group as the configured reviewers can auto-validate their own request. Only meaningful for review_type='group'; the form hides this field for the other review types."string='Four-eyes Principle' -
has_commentBooleandefault=Falsestring='Comment' -
modelCharindex=Truerelated='model_id.model'store=True -
model_idMany2one → ir.modelcomodel_name='ir.model'domain=<expr>string='Referenced Model' -
nameChardefault=<expr>required=Truestring='Description'translate=True -
notify_on_acceptedBooleanhelp='If set, reviewers will be notified by email when a review related to this definition is accepted.'string='Notify Reviewers on Accepted' -
notify_on_createBooleanhelp='If set, all possible reviewers will be notified by email when this definition is triggered.'string='Notify Reviewers on Creation' -
notify_on_pendingBooleanhelp="If set, all possible reviewers will be notified by email when this status is reached.Usefull in an Approve by sequence scenario. An notification request to review is sent out when it's their turn to review."string='Notify Reviewers on reaching Pending' -
notify_on_rejectedBooleanhelp='If set, reviewers will be notified by email when a review related to this definition is rejected.'string='Notify Reviewers on Rejected' -
notify_on_restartedBooleanhelp='If set, reviewers will be notified by email when a reviews related to this definition are restarted.'string='Notify Reviewers on Restarted' -
notify_reminder_delayIntegerhelp='Remind the reviewers every this many days while their review is pending. Leave at 0 to send no reminder.'string='Remind Every (Days)' -
review_typeSelectiondefault='individual'selection=[('individual', 'Specific user'), ('group', 'Any user in a specific group'), ('field', 'Field in related record')]string='Validated by' -
reviewer_field_idMany2one → ir.model.fieldscomodel_name='ir.model.fields'domain="[('id', 'in', valid_reviewer_field_ids)]"string='Reviewer field' -
reviewer_group_idMany2one → res.groupscomodel_name='res.groups'string='Reviewer group' -
reviewer_idMany2one → res.userscomodel_name='res.users' -
sequenceIntegerdefault=30 -
valid_reviewer_field_idsOne2many → ir.model.fieldscomodel_name='ir.model.fields'compute='_compute_domain_reviewer_field'
-
onchange_review_type(self)@api.onchange('review_type')
-
approve_sequenceBooleanrelated='definition_id.approve_sequence' -
approve_sequence_bypassBooleanrelated='definition_id.approve_sequence_bypass' -
can_reviewBooleancompute='_compute_can_review'help='Can review will be marked if the review is pending and the\n approve sequence has been achieved'store=True -
commentCharstring='Comments' -
company_idMany2onerelated='definition_id.company_id'store=True -
definition_idMany2one → tier.definitioncomodel_name='tier.definition' -
display_statusCharcompute='_compute_display_status' -
done_byMany2one → res.userscomodel_name='res.users' -
has_commentBooleanrelated='definition_id.has_comment' -
last_reminder_dateDatetimereadonly=True -
modelCharindex=Truestring='Related Document Model' -
nameCharrelated='definition_id.name' -
pending_dateDatetimecopy=Falsehelp='When the review became pending, i.e. when its reviewers could act on it. With Approve by sequence that is when the previous tier was validated, not when the validation was requested.'readonly=Truestring='Pending Since' -
requested_byMany2one → res.userscomodel_name='res.users' -
res_idMany2oneReferenceindex=Truemodel_field='model'string='Related Document ID' -
review_typeSelectionrelated='definition_id.review_type' -
reviewed_dateDatetimestring='Validation Date' -
reviewed_formated_dateCharcompute='_compute_reviewed_formated_date'string='Validation Formated Date' -
reviewer_field_idMany2onerelated='definition_id.reviewer_field_id' -
reviewer_group_idMany2onerelated='definition_id.reviewer_group_id' -
reviewer_idMany2onerelated='definition_id.reviewer_id' -
reviewer_idsMany2many → res.userscomodel_name='res.users'compute='_compute_reviewer_ids'store=Truestring='Reviewers' -
sequenceIntegerstring='Tier' -
statusSelectiondefault='waiting' args: [('waiting', 'Waiting'), ('pending', 'Pending'), ('rejected', 'Rejected'), ('approved', 'Approved'), ('cancel', 'Cancel')] -
todo_byCharcompute='_compute_todo_by'store=True
-
create(self, vals_list)@api.model_create_multi -
write(self, vals)
-
can_reviewBooleancompute='_compute_can_review'search='_search_can_review' -
has_commentBooleancompute='_compute_has_comment'help='If set, Allow the reviewer to leave a comment on the review.' -
hide_reviewsBooleancompute='_compute_hide_reviews' -
need_validationBooleancompute='_compute_need_validation' -
next_reviewCharcompute='_compute_next_review' -
rejected_messageHtmlcompute='_compute_rejected_message' -
review_idsOne2many → tier.reviewbypass_search_access=Truecomodel_name='tier.review'domain=<expr>inverse_name='res_id'string='Validations' -
reviewer_idsMany2many → res.userscomodel_name='res.users'compute='_compute_reviewer_ids'search='_search_reviewer_ids'string='Reviewers' -
to_validate_messageHtmlcompute='_compute_to_validate_message' -
validated_messageHtmlcompute='_compute_validated_message' -
validation_statusSelectioncompute='_compute_validation_status'default='no'selection=[('no', 'Without validation'), ('waiting', 'Waiting'), ('pending', 'Pending'), ('rejected', 'Rejected'), ('validated', 'Validated')]store=True
-
evaluate_tier(self, tier) -
get_view(self, view_id=None, view_type='form', **options)@api.model -
reject_tier(self) -
request_validation(self) -
restart_validation(self) -
unlink(self) -
validate_tier(self) -
write(self, vals)
-
activeBooleandefault=True -
allowed_to_write_after_validationBooleandefault=Truestring='Write after Validation' -
allowed_to_write_under_validationBooleandefault=Truestring='Write under Validation' -
company_idMany2one → res.companycomodel_name='res.company'default=<expr> -
field_idsMany2many → ir.model.fieldscomodel_name='ir.model.fields'domain="[('id', 'in', valid_model_field_ids)]"required=Truestring='Fields' -
group_idsMany2many → res.groupscomodel_name='res.groups'help='Allowed groups to use this Tier Validation Exception'string='Groups' -
model_idMany2one → ir.modelcomodel_name='ir.model'domain=<expr>ondelete='cascade'required=True -
model_nameCharindex=Truerelated='model_id.model'store=Truestring='Model Name' -
nameChardefault='New Tier Validation Exception'required=True -
valid_model_field_idsOne2many → ir.model.fieldscomodel_name='ir.model.fields'compute='_compute_valid_model_field_ids'
No public methods.
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…