[19.0][FIX] mis_builder: widget instance resolution on Odoo 19 (props.value removed)#809
Open
Hotdgo9 wants to merge 1 commit into
Open
[19.0][FIX] mis_builder: widget instance resolution on Odoo 19 (props.value removed)#809Hotdgo9 wants to merge 1 commit into
Hotdgo9 wants to merge 1 commit into
Conversation
… removed) On Odoo 19 the owl field API no longer provides props.value, so _instanceId() fell through to context.active_id. Any mis.report.instance form opened without active_id in the context (e.g. a plain act_window with res_id behind a menuitem) crashed in willStart: orm.read received [undefined] and raised "Invalid ids list", leaving the view unusable. Resolve the instance from this.props.record.resId first (the modern field API), keeping the props.value and active_id fallbacks for legacy call sites and the dashboard case. mis_builder's own flows never hit this because preview()/print_pdf() pass a context carrying active_id, which is why CI stays green. 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.
Root cause
On Odoo 19 the owl field API no longer provides
props.value, soMisReportWidget._instanceId()(mis_builder/static/src/components/mis_report_widget.esm.js) falls straight through tothis.props.record.context.active_id. Anymis.report.instanceform opened withoutactive_idin its context crashes inwillStart:orm.read("mis.report.instance", [undefined], ...)raises anOwlError— "Invalid ids list" — and the view is unusable.This happens with a completely standard setup, e.g. a plain
act_windowwithres_idbehind a menuitem:Before this fix: opening that menu crashes with "Invalid ids list". After: the report renders normally.
Why CI stays green
mis_builder's own flows never hit the broken path:
preview()andprint_pdf()return actions whose context carriesactive_id(fromenv.context), so theactive_idfallback always works there. Only externally-defined actions/menuitems withoutactive_idexpose the bug — nothing in the test suite exercises that.The fix
Resolve the instance from
this.props.record.resIdfirst — the modern owl field API: when the widget is used as a field in amis.report.instanceform view, the record it belongs to is the instance. Theprops.valueandcontext.active_idfallbacks are kept (with a comment) for legacy call sites and the dashboard trick, where the view is not bound to a record.Testing
mis_builderPython suite run against this branch on Odoo 19 (module bind-mounted into a clean database): with demo data all tests pass; without demo data 91/92 pass, the sole failure being the pre-existingtest_drilldown_action_name_with_accountno-demo issue addressed separately in [19.0][FIX] mis_builder: test_drilldown_action_name_with_account on no-demo DB #808 — unrelated to this change.prettier --checkandeslintpass on the touched file.Workaround for affected users (pre-fix)
Add the instance id to the action context so the legacy fallback kicks in:
🤖 Generated with Claude Code