Skip to content

[18.0][FIX] base_tier_validation: use validation_status for readonly domain#1246

Open
bosd wants to merge 1 commit intoOCA:18.0from
bosd:18.0-fix-tier-validation-readonly-domain
Open

[18.0][FIX] base_tier_validation: use validation_status for readonly domain#1246
bosd wants to merge 1 commit intoOCA:18.0from
bosd:18.0-fix-tier-validation-readonly-domain

Conversation

@bosd
Copy link
Contributor

@bosd bosd commented Mar 3, 2026

Description

The _get_tier_validation_readonly_domain method currently returns bool(review_ids) which is injected as a readonly domain modifier on all form fields via get_view().

In Odoo 18, the web client does not always include One2many fields like review_ids in the data spec during form re-renders (e.g. after a status change or button click), causing an OWL rendering error:

Name 'review_ids' is not defined

This happens for example when cancelling a sale order that has tier validation configured.

Fix

Replace the readonly domain with validation_status not in ('no', False) which uses the stored computed validation_status Selection field instead. This field is always available in the form data spec and provides the same semantics: fields become readonly when a validation process is active (pending, approved, or rejected).

The validation_status field is already defined on the tier.validation mixin with values: no, pending, approved, rejected.

The `_get_tier_validation_readonly_domain` method returns
`bool(review_ids)` which is injected as a readonly domain modifier on
all form fields via `get_view()`. In Odoo 18, the web client does not
always include One2many fields like `review_ids` in the data spec during
form re-renders (e.g. after a status change or button click), causing an
OWL rendering error:

    Name 'review_ids' is not defined

Replace the domain with `validation_status not in ('no', False)` which
uses the stored computed `validation_status` Selection field instead.
This field is always available in the form data spec and provides the
same semantics: fields become readonly when a validation process is
active (pending, approved, or rejected).
@OCA-git-bot
Copy link
Contributor

Hi @LoisRForgeFlow,
some modules you are maintaining are being modified, check this out!

@bosd bosd changed the title [FIX] base_tier_validation: use validation_status for readonly domain [18.0][FIX] base_tier_validation: use validation_status for readonly domain Mar 3, 2026
Copy link
Contributor

@LoisRForgeFlow LoisRForgeFlow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants