Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions base_tier_validation/models/tier_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,9 @@ def evaluate_tier(self, tier):
else:
return self

@api.model
def _get_validation_exceptions(self, extra_domain=None, add_base_exceptions=True):
def _get_exception_fields(self, extra_domain=None):
"""Return Tier Validation Exception field names that matchs custom domain."""
exception_fields = (
return (
self.env["tier.validation.exception"]
.sudo()
.search(
Expand All @@ -292,6 +291,11 @@ def _get_validation_exceptions(self, extra_domain=None, add_base_exceptions=True
)
.mapped("field_ids.name")
)

@api.model
def _get_validation_exceptions(self, extra_domain=None, add_base_exceptions=True):
"""Return Tier Validation Exception field names that matchs custom domain."""
exception_fields = self._get_exception_fields(extra_domain=extra_domain)
if add_base_exceptions:
exception_fields += BASE_EXCEPTION_FIELDS
return list(set(exception_fields))
Expand Down
1 change: 1 addition & 0 deletions base_tier_validation/tests/test_tier_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,7 @@ def test_27_change_field_exception_validation(self):
# Able to write test_validation_field after validation
with mock.patch.multiple(
TV,
_get_exception_fields=mock.MagicMock(return_value=_tvf),
_get_validation_exceptions=mock.MagicMock(return_value=_tvf),
_get_after_validation_exceptions=mock.MagicMock(return_value=_rv),
):
Expand Down