Skip to content

[FIX] base_exception: reload the view after the exception dialog - #3734

Open
lef-adhoc wants to merge 1 commit into
OCA:18.0from
adhoc-dev:18.0-t-75452-lef
Open

lef-adhoc wants to merge 1 commit into
OCA:18.0from
adhoc-dev:18.0-t-75452-lef

Conversation

@lef-adhoc

Copy link
Copy Markdown
Contributor

The problem

Confirm a sales order that hits an exception rule. The dialog shows up, you tick Ignore Exceptions and confirm.

The order is confirmed — but the view behind the dialog still shows it as a quotation, with the red exception banner and the Confirm button. You have to reload the page by hand to see the real state, and until you do you can hit Confirm again on an order that is already confirmed.

How to reproduce

On 18.0 with sale_exception installed:

  1. Add an exception.rule on sale.order, by_py_code, that matches one customer.
  2. Create an order for that customer and confirm it → the exception dialog shows up.
  3. Tick Ignore Exceptions and confirm.
  4. The view still shows Quotation, but the order is already sale in the database. Reload the page and the real state appears.

Why

The dialog can change the record: ticking "Ignore Exceptions" calls action_confirm on it. But the wizard returns ir.actions.act_window_close, which closes the dialog and nothing else, so the view keeps the state it had before.

The fix

Reload once the dialog is closed, using the onClose option of doAction:

await env.services.action.doAction(popupAction, {
    onClose: () =>
        env.services.action.doAction({
            type: "ir.actions.client",
            tag: "soft_reload",
        }),
});

It goes here rather than in the wizard's return value for two reasons: action_confirm on the wizard is inherited by several modules, and this way the fix covers every model using the mechanism, not just sales.

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @hparfr, @sebastienbeau,
some modules you are maintaining are being modified, check this out!

@lef-adhoc lef-adhoc changed the title [WIP] [FIX] base_exception: reload the view after the exception dialog [FIX] base_exception: reload the view after the exception dialog Sep 18, 2026
@lef-adhoc

lef-adhoc commented Sep 18, 2026

Copy link
Copy Markdown
Contributor Author

@grindtildeath could you take a look? This follows up on #3590 and OCA/sale-workflow#4255, so you are the one with the context.

The dialog can now confirm the record, and closing it leaves the view showing the previous state. Reloading on close seemed like the smallest fix

The dialog can confirm the record (ticking "Ignore Exceptions" calls
action_confirm on it), but closing it only closes the dialog: the view
underneath keeps showing the record as it was before, so the user sees a
quotation that is already a sales order.

Reload once the dialog closes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants