[18.0][FIX] web_ir_actions_act_window_message: env.services.rpc is not a function#3264
Conversation
cce3746 to
2fe09fb
Compare
b145a94 to
4b373aa
Compare
|
@yvaucher @miguel-S73 When using this module I get this errors, can you review it?? |
ae7f587 to
5bb7c4b
Compare
5bb7c4b to
613a71e
Compare
|
This PR has the |
|
@OCA/website-maintainers Please, can you merge this PR? |
There was a problem hiding this comment.
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)
eeea0d4 to
7d20ef1
Compare
|
@hbrunn Changes made, thanks for the feedback! |
|
please remove env in |
7d20ef1 to
ba6c5ca
Compare
|
@hbrunn done |
hbrunn
left a comment
There was a problem hiding this comment.
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
|
This PR looks fantastic, let's merge it! |
|
Congratulations, your PR was merged at be59864. Thanks a lot for contributing to OCA. ❤️ |
1 - When creating an "ir.actions.act_window.message" and clicking on the buttons, this error appears:
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.
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:
In this case, the
controllerStackarray contains a list view, but it doesn't contain theviewfield.If we access the sale.order form view directly from the list view without refreshing the page, the
controllerStackarray correctly contains the list view information.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.