Conversation
UsmanGhias
reviewed
Sep 25, 2026
UsmanGhias
left a comment
There was a problem hiding this comment.
Clean patch for OCA/sale-workflow.
Observations:
- The targeted patch addresses the issue cleanly without introducing side effects across related models.
Ready for testing on standard environments.
Best,
Usman
_validate_order() is called by frontend flows (portal signature, free e-commerce orders) after writing on the order in the same transaction, so the second cursor of detect_exceptions() waits forever on the row lock. There is also no client handler for BaseExceptionError there. Detect the exceptions without rollback in _validate_order(): blocked orders stay unconfirmed, keep what was written (e.g. the signature) and get an internal note with the exceptions. The other orders are confirmed as before.
gal-adhoc
force-pushed
the
18.0-t-75454-gal
branch
from
September 29, 2026 14:24
70d84bf to
197143f
Compare
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.
Depends on OCA/server-tools#3741. Follow-up of #4255.
Problem
Signing a quotation in the customer portal hangs when an exception rule applies:
portal_quote_acceptwrites the signature and flushes: the order row is locked by the ongoing transaction._validate_order()→action_confirm()→detect_exceptions()writes the exceptions through a second cursor on that same row, and waits forever.Even without the lock, the
BaseExceptionErrorwould roll back the signature, and its client handler only lives inweb.assets_backend: the portal would show the raw{"src_model": "sale.order", ...}payload. The free order flow ofwebsite_salegoes through_validate_order()too.Change
_validate_order()detects the exceptions without rollback (base_exception_no_rollback, scoped to these orders):The customer still gets the standard "signed" message: this is the behavior before #4255, when the confirmation silently returned the popup action.
Open question
sale_loyaltyalso overrides_validate_order()and there is no dependency between both modules. If it ends up abovesale_exception, it may try to invoice a zero-amount rewarded order that was not confirmed (withsale.automatic_invoice). Not handled here; feedback welcome.Tests
tests/test_validate_order.py: blocked order (not confirmed, signature kept, note posted), order without exceptions (confirmed) and a mixed batch. The lock itself cannot be reproduced in aTransactionCase(a separate connection does not see the uncommitted order), so it was checked manually on a real server: the portal request answers in ~2s instead of hanging.