[FIX] website_sale_require_legal: fix race condition in UI tour test#1170
Open
Kimkhoi3010 wants to merge 1 commit intoOCA:16.0from
Open
[FIX] website_sale_require_legal: fix race condition in UI tour test#1170Kimkhoi3010 wants to merge 1 commit intoOCA:16.0from
Kimkhoi3010 wants to merge 1 commit intoOCA:16.0from
Conversation
pedrobaeza
requested changes
Feb 25, 2026
Member
pedrobaeza
left a comment
There was a problem hiding this comment.
You can't use self.env["loyalty.program"] in a module that don't depend on the module adding that model, so you have to find another solution.
3c86591 to
876ab5a
Compare
Author
Hi @pedrobaeza, I have updated the PR. Thanks for your time. |
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.
Context
sale_loyaltyis installed alongsidewebsite_sale_require_legal.web.assets_frontend_lazy) initializes asynchronously. The submit button starts asdisabled="true"in the HTML template and is only enabled by the widget's_enableButton()after async initialization completes.button[name="o_payment_submit_button"]while it was still disabled, no event handler fired, no AJAX was sent to /shop/payment/transaction, and the browser never navigated — causing the final form.oe_product_cart step to time out.Changes
static/tests/tours/tour.js:form.oe_product_carton the shop page, ensuring the AJAX call has completed before the tour ends.tests/test_ui.py:action="/shop/payment/validate"so the browser navigates to /shop only after the AJAX response is received.