Skip to content

[18.0][FIX] mis_builder: guard against falsy drilldown action#777

Closed
dnplkndll wants to merge 1 commit intoOCA:18.0from
ledoent:18.0-fix-drilldown-false
Closed

[18.0][FIX] mis_builder: guard against falsy drilldown action#777
dnplkndll wants to merge 1 commit intoOCA:18.0from
ledoent:18.0-fix-drilldown-false

Conversation

@dnplkndll
Copy link

Description

Clicking a computed KPI cell (e.g. profit - loss) in the MIS report
widget triggers a JS error:

No view found for act_window action undefined

Root cause

mis_report_instance.drilldown() returns False when the expression
has no account variable (AEP.has_account_var() is False for computed
expressions). The JS handler passes this falsy value directly to
this.action.doAction().

Fix

Add a truthy check before calling doAction().

Closes #776

When a user clicks a computed KPI cell (e.g. ``profit - loss``),
``mis_report_instance.drilldown()`` returns ``False`` because the
expression has no account variable.  The JS handler passed this
falsy value to ``doAction()`` which threw:

    No view found for act_window action undefined

Add a truthy check before calling ``doAction()``.

Closes OCA#776

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@OCA-git-bot
Copy link
Contributor

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

@sbidoul
Copy link
Member

sbidoul commented Mar 23, 2026

Hi, this change looks good but I really wonder why such a cell would be clickable in the first place.

For instance with the demo report you can see on runboat, the Total row is not clickable.

@dnplkndll
Copy link
Author

Closing this — the root cause turned out to be a migration issue, not a missing JS guard.

After migrating from 17.0 to 18.0, source_aml_model_id (a stored computed field introduced in 18.0) is NULL on all existing mis.report.instance.period records. This causes drilldown() to return an action with res_model: False, which the JS then fails on with "No view found for act_window action undefined".

On a clean 18.0 install, source_aml_model_id is computed correctly and drilldown works fine — no JS guard needed.

The proper fix is a migration script to recompute the field: #780 / ledoent#3

@dnplkndll dnplkndll closed this Mar 24, 2026
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.

[18.0][BUG] mis_builder: JS error on drilldown for computed KPI lines

3 participants