[19.0][FIX] mis_builder: test_drilldown_action_name_with_account on no-demo DB - #808
Open
Hotdgo9 wants to merge 1 commit into
Open
[19.0][FIX] mis_builder: test_drilldown_action_name_with_account on no-demo DB#808Hotdgo9 wants to merge 1 commit into
Hotdgo9 wants to merge 1 commit into
Conversation
On a database without demo data, account.account.search([], limit=1)
returns an empty recordset, so the expected action name embeds "False"
("kpi 1 - False - p1") while _get_drilldown_action_name correctly takes
the account-less branch ("kpi 1 - p1"), making the test fail. Create the
account in the test instead of relying on pre-existing data.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
|
Hi @sbidoul, |
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.
test_drilldown_action_name_with_accountfails on a database without demo data.Root cause: the test does
self.env["account.account"].search([], limit=1), which returns an empty recordset when no chart of accounts is loaded. The expected string then embedsFalse:The production code is correct —
_get_drilldown_action_nameproperly takes the account-less branch for a falsyaccount_id. It is the test's data assumption that breaks.Repro: install
mis_builderon a fresh no-demo database (stockodoo:19.0) with--test-enable; the test fails withAssertionErrorat theassert action_name == expected_nameline. Found while validating 19.0 on a production-like no-demo database.Fix: create the
account.accountin the test instead of relying on pre-existing data, so the search-for-any-account is replaced by a deterministic fixture and the with-account branch is actually exercised on any database.Verified locally on
odoo:19.0without demo data: the single test fails before / passes after, and the fullTestMisReportInstanceclass is green (27 tests, 0 failures).🤖 Generated with Claude Code