odoo/odoo#203454
Created by Website, Rudra Patel (paru)
Blocked
- Merge method
- Review
-
CI
- legal/cla: Contributor License Agreement check
- ci/runbot: Odoo Test Suite
- ci/upgrade_enterprise: Test upgrades for enterprise master
- ci/template: Contact runbot team on discord for help.
- ci/style: Optional style check. Ignore it only if strictly necessary.
- ci/security: Required security check. Can only be ignored by security team.
- label
- odoo-dev:17.0-fix-snippet-oriented-fixing-paru
- head
- 65fba663e0a4a205815bb1feeb9a8ab9621c758a
| odoo/odoo | |
|---|---|
| 17.0 | #203454 missing r+ |
| 18.0 | |
| saas-18.2 | |
| saas-18.3 | |
| saas-18.4 | |
| 19.0 | |
| master |
[FIX] web_editor, *: resolve some snippet oriented tracebacks
*:website, website_payment
> Commit 1:
[FIX] web_editor: prevent infinite bounce loop when clicking undo
Steps to reproduce:
1. Click on a snippet without dragging it.
2. Notice that the "Drag building blocks here" section starts bouncing.
3. Observe that a step is added to the history (Undo becomes available).
4. Click on Undo button.
Issue:
1. The o_catch_attention class is repeatedly added and removed, creating unnecessary history steps in the editor.
2. No actual changes occur in the wrap area, yet the editor records history steps.
3. This leads to an infinite bounce loop when using Undo/Redo.
Expected behavior:
1. The Undo button should not be activated.
2. Infinite bouncing should not occur.
This PR prevents unnecessary history steps by disabling history tracking during this phase using observerUnactive and observerActive. This ensures that the editor does not record redundant changes, preventing infinite bounce loops.
> Commit 2:
[FIX] website_payment: fix donation amount not updating issue
Steps to Reproduce:
1. Go to Website → Add a Donation snippet.
2. Enter a custom amount and click "Donate". You will be redirected to the donation/pay page.
3. Use the browser's back button to return to the previous page.
4. Change the amount in the custom amount field.
5. Click "Donate" again.
- The old amount is still used instead of the new one.
Expected Behavior:
The donation amount should update correctly when changed.
The issue occurs because clicking the "Donate Now" button appends a hidden value to the form snippet, which is then used in payment_form. When navigating back and selecting "Donate Now" again, a duplicate hidden value is added instead of replacing the previous one. This PR ensures that if a value already exists, it is replaced instead of being
appended, resolving the issue.
> Commit 3:
[FIX] web_editor: fix dropdown options value
Steps to reproduce:
1. Go to the website and drag and drop the form snippet.
2. Change the action to 'Subscribe to Newsletter'.
3. Click on multi-checkbox field to view its options.
- Even after selecting an option, it remains in the dropdown, allowing multiple selections of the same option.
Expected behaviour:
- Once an option is selected, it should be removed from the dropdown.
Solution:
This PR removes the count from the display name, ensuring correct form behavior.