odoo icon indicating copy to clipboard operation
odoo copied to clipboard

[FIX] web, *: website stuck different scenario

Open fw-bot opened this issue 5 months ago • 6 comments

* : website, web_editor, html_editor

Commit [1]:

Steps to reproduce: replacing image stuck issue when deleted

  1. Go to Website > Edit.
  2. Add any picture snippet (e.g., Text-Image).
  3. Click the 'Replace' button and upload an image.
  4. Open the media dialog again and delete the uploaded image.
  5. Click the 'Discard' button.
  6. Try to save the changes.

Issue:

  • The website gets stuck in the same position and does not allow saving.
  • In the Python terminal, a missing error warning appears because the image is deleted from both ir.ui.view and ir.attachment.

Expected behaviour:

  • Saving should be allowed with a default image, that is similar to other images.

This commit catch the warning response and replaces the deleted image, allowing the website to save changes without getting stuck.

Commit [2]: resolve traceback when leaving edit mode via browser

Steps to reproduce:

  1. Go to Website > Edit.
  2. Open the snippet modal and select any snippet.
  3. Press the 'Back' button in your browser.
  4. A dialog will appear asking to discard changes; click 'OK'.
  5. A traceback error occurs, and an empty space appears in the editor.

Issue:

  • Previously, a commit addressed a similar scenario, but that time the browser had an event listener bind on hashchange.
  • Now, that hashchange event of browser has been replaced with popstate, which triggers before the 'window' event listener.
  • As a result, the editor is left in an unstable state, causing a traceback error.

Solution:

  • This commit ensures the 'window' event executes before the browser event.
  • It verifies if the editor is open and forces a skipLoad, preventing the route_change call in the browser.

task-4570164

Forward-Port-Of: odoo/odoo#199193

fw-bot avatar Nov 14 '25 13:11 fw-bot

Pull request status dashboard

robodoo avatar Nov 14 '25 13:11 robodoo

@paru-odoo @bso-odoo cherrypicking of pull request odoo/odoo#199193 failed.

  • f051c142e426ec2edc16b4d119d72b755aa81225
  • 89d541d8c25f46da5fa145db3cfcefdef2eb69c6 <- on this commit

stdout:

Auto-merging addons/web/static/src/core/browser/router.js
Auto-merging addons/website/static/src/components/wysiwyg_adapter/wysiwyg_adapter.js
Auto-merging addons/website/static/tests/tours/media_dialog.js
Auto-merging addons/website/tests/test_ui.py
CONFLICT (content): Merge conflict in addons/website/tests/test_ui.py

Either perform the forward-port manually (and push to this branch, proceeding as usual) or close this PR (maybe?).

In the former case, you may want to edit this PR message as well.

:warning: after resolving this conflict, you will need to merge it via @robodoo.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

fw-bot avatar Nov 14 '25 13:11 fw-bot

@paru-odoo @bso-odoo this forward port of odoo/odoo#199193 is awaiting action (not merged or closed).

fw-bot avatar Nov 22 '25 02:11 fw-bot

@paru-odoo @bso-odoo this forward port of odoo/odoo#199193 is awaiting action (not merged or closed).

fw-bot avatar Nov 29 '25 02:11 fw-bot

@paru-odoo @bso-odoo this forward port of odoo/odoo#199193 is awaiting action (not merged or closed).

fw-bot avatar Dec 06 '25 02:12 fw-bot

@paru-odoo @bso-odoo this forward port of odoo/odoo#199193 is awaiting action (not merged or closed).

fw-bot avatar Dec 13 '25 02:12 fw-bot