Skip to content

[19.0][FIX] mis_builder: test_drilldown_action_name_with_account on no-demo DB - #808

Open
Hotdgo9 wants to merge 1 commit into
OCA:19.0from
Hotdgo9:19.0-fix-test_drilldown_action_name_with_account
Open

[19.0][FIX] mis_builder: test_drilldown_action_name_with_account on no-demo DB#808
Hotdgo9 wants to merge 1 commit into
OCA:19.0from
Hotdgo9:19.0-fix-test_drilldown_action_name_with_account

Conversation

@Hotdgo9

@Hotdgo9 Hotdgo9 commented Jul 6, 2026

Copy link
Copy Markdown

test_drilldown_action_name_with_account fails 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 embeds False:

expected: "kpi 1 - False - p1"
actual:   "kpi 1 - p1"

The production code is correct — _get_drilldown_action_name properly takes the account-less branch for a falsy account_id. It is the test's data assumption that breaks.

Repro: install mis_builder on a fresh no-demo database (stock odoo:19.0) with --test-enable; the test fails with AssertionError at the assert action_name == expected_name line. Found while validating 19.0 on a production-like no-demo database.

Fix: create the account.account in 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.0 without demo data: the single test fails before / passes after, and the full TestMisReportInstance class is green (27 tests, 0 failures).

🤖 Generated with Claude Code

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>
@OCA-git-bot

Copy link
Copy Markdown
Contributor

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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants