Skip to content

[18.0][FIX] web_ir_actions_act_window_message: env.services.rpc is not a function#3264

Merged
OCA-git-bot merged 1 commit into
OCA:18.0from
Studio73:18.0-fix-web_ir_actions_act_window_message
Nov 14, 2025
Merged

[18.0][FIX] web_ir_actions_act_window_message: env.services.rpc is not a function#3264
OCA-git-bot merged 1 commit into
OCA:18.0from
Studio73:18.0-fix-web_ir_actions_act_window_message

Conversation

@sergioM-S73
Copy link
Copy Markdown
Contributor

@sergioM-S73 sergioM-S73 commented Aug 28, 2025

1 - When creating an "ir.actions.act_window.message" and clicking on the buttons, this error appears:

image

I have refactored the component to use "useService" for ORM, removing the use of env.services.rpc

2 - After, testing with an ir_actions_act_window_message in sale.order, which contains a button that triggers the action_confirm action, I encountered this error.

image

This happens because if the page is refreshed within the form view of the sale.order, the context of the list view is lost, so when the switchView function is called, it executes this code:

image

In this case, the controllerStack array contains a list view, but it doesn't contain the view field.

image

If we access the sale.order form view directly from the list view without refreshing the page, the controllerStack array correctly contains the list view information.

image

The _refreshWidget function has been modified to prevent this error when the user refreshes the page in the form view, and it now triggers a window.location.reload() to maintain functionality.

@sergioM-S73 sergioM-S73 force-pushed the 18.0-fix-web_ir_actions_act_window_message branch from cce3746 to 2fe09fb Compare August 28, 2025 11:40
@sergioM-S73 sergioM-S73 changed the title fix-error: env.services.rpc is not a function [18.0][FIX] web_ir_actions_act_window_message: env.services.rpc is not a function Aug 28, 2025
@sergioM-S73 sergioM-S73 force-pushed the 18.0-fix-web_ir_actions_act_window_message branch 2 times, most recently from b145a94 to 4b373aa Compare August 28, 2025 15:48
@sergioM-S73
Copy link
Copy Markdown
Contributor Author

sergioM-S73 commented Sep 17, 2025

@yvaucher @miguel-S73 When using this module I get this errors, can you review it??

@sergioM-S73 sergioM-S73 force-pushed the 18.0-fix-web_ir_actions_act_window_message branch 2 times, most recently from ae7f587 to 5bb7c4b Compare September 18, 2025 10:08
@sergioM-S73 sergioM-S73 force-pushed the 18.0-fix-web_ir_actions_act_window_message branch from 5bb7c4b to 613a71e Compare November 5, 2025 12:33
Copy link
Copy Markdown

@Reyes4711-S73 Reyes4711-S73 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Contributor

@adrip-s73 adrip-s73 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@OCA-git-bot
Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@Reyes4711-S73
Copy link
Copy Markdown

@OCA/website-maintainers Please, can you merge this PR?

Copy link
Copy Markdown
Member

@hbrunn hbrunn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for this, I wonder if this ever worked or if the v18 migration just was a horrible hack job.

Given env from props isn't used any more, please remove all references to this.

And please review #3353 to avoid this kind of unpleasantness in the future (actual unittests pending)

Comment thread web_ir_actions_act_window_message/__manifest__.py Outdated
@sergioM-S73 sergioM-S73 force-pushed the 18.0-fix-web_ir_actions_act_window_message branch 2 times, most recently from eeea0d4 to 7d20ef1 Compare November 12, 2025 08:23
@sergioM-S73
Copy link
Copy Markdown
Contributor Author

@hbrunn Changes made, thanks for the feedback!

@sergioM-S73 sergioM-S73 requested a review from hbrunn November 12, 2025 08:54
@hbrunn
Copy link
Copy Markdown
Member

hbrunn commented Nov 12, 2025

please remove env in web_ir_actions_act_window_message.esm.js too

@sergioM-S73 sergioM-S73 force-pushed the 18.0-fix-web_ir_actions_act_window_message branch from 7d20ef1 to ba6c5ca Compare November 12, 2025 12:13
@sergioM-S73
Copy link
Copy Markdown
Contributor Author

@hbrunn done

Copy link
Copy Markdown
Member

@hbrunn hbrunn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, if you put this into your v19 migration, that should be fine too.

You might want to review the PR I pointed to for having this merged in v18

/ocabot merge patch

@OCA-git-bot
Copy link
Copy Markdown
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 18.0-ocabot-merge-pr-3264-by-hbrunn-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 2ce972c into OCA:18.0 Nov 14, 2025
9 checks passed
@OCA-git-bot
Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at be59864. Thanks a lot for contributing to OCA. ❤️

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.

6 participants