Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] website_sale: sale ribbons disappearing #135908

Conversation

ande-odoo
Copy link
Contributor

@ande-odoo ande-odoo commented Sep 19, 2023

Current behaviour:

When removing the ribbon from a product,
the other ribbons are removed as well.

Steps to reproduce:

  1. Go to website
  2. Go to Shop
  3. Click on Edit (top right)
  4. Add a ribbon to multiple products
  5. Click on Save
  6. Select a product with a ribbon
  7. Remove the ribbon
  8. (other ribbons are gone)

Cause of the issue:

Reverting fix introduced by 5d13fa5
t-out was modified into t-field to be considered dirty when modified.
but when removing a ribbon, t-field is set as empty,
which overwrites ribbons html value.

opw-3487397


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

@robodoo
Copy link
Contributor

robodoo commented Sep 19, 2023

Pull request status dashboard

@ande-odoo ande-odoo force-pushed the 16.0-OPW_3487397-website_sale-ribbons_disappears-ande branch from d137ad1 to bfb634d Compare September 19, 2023 12:07
@C3POdoo C3POdoo added the OE the report is linked to a support ticket (opw-...) label Sep 19, 2023
@ande-odoo ande-odoo force-pushed the 16.0-OPW_3487397-website_sale-ribbons_disappears-ande branch from bfb634d to 7d919d0 Compare September 19, 2023 13:39
@loco-odoo
Copy link
Contributor

Hello @ande-odoo 👋
While testing your PR, I reported few stuffs ;)

  • The o_dirty class is added on the ribbon when clicking on the image. IMO, this should not be the case and this class should only be added when modifying the ribbon. (to solve the problem, the editor observer should probably be paused somewhere (grep odooEditor.observerUnactive)).
  • Sometime, when you create a new badge, the o_dirty class is still there after the saving and if you try to remove the ribbon afterwards, it does not work.

I made a video to make thinks clearer ;)
Screencast from 09-25-2023 02:16:54 PM.webm

@loco-odoo
Copy link
Contributor

loco-odoo commented Oct 9, 2023

Hello @ande-odoo 👋
I had a look on why the o_dirty class is added on the ribbon when you click on an image product and it seems to come from the insertion and remove of the o_we_force_no_transition class in the _computeWidgetState() logic of the SnippetOptionWidget (addons/web_editor/static/src/js/editor/snippets.options.js). If you pause the observer while adding and removing this class, the o_dirty class will not be added on the ribbon when you click on the product image ;)

@ande-odoo ande-odoo force-pushed the 16.0-OPW_3487397-website_sale-ribbons_disappears-ande branch from 7d919d0 to d0d592e Compare October 12, 2023 09:38
@ande-odoo ande-odoo marked this pull request as ready for review October 12, 2023 15:21
@C3POdoo C3POdoo requested review from a team October 12, 2023 15:22
@ande-odoo ande-odoo force-pushed the 16.0-OPW_3487397-website_sale-ribbons_disappears-ande branch from d0d592e to 308f61f Compare October 13, 2023 16:07
@AntoineVDV AntoineVDV removed the request for review from a team October 16, 2023 14:49
@ande-odoo ande-odoo force-pushed the 16.0-OPW_3487397-website_sale-ribbons_disappears-ande branch from 308f61f to decadfc Compare December 4, 2023 16:21
Current behaviour:
When removing the ribbon from a product,
the other ribbons are removed as well.

Steps to reproduce:
1. Go to website
2. Go to Shop
3. Click on Edit (top right)
4. Add a ribbon to multiple products
5. Click on Save
6. Select a product with a ribbon
7. Remove the ribbon
8. (other ribbons are gone)

Cause of the issue:
Reverting fix introduced by odoo@5d13fa5
t-out was modified into t-field to be considered dirty when modified.
but when removing a ribbon, t-field is set as empty,
which overwrites ribbons html value.

opw-3487397
@ande-odoo ande-odoo force-pushed the 16.0-OPW_3487397-website_sale-ribbons_disappears-ande branch from decadfc to 08b5d0f Compare December 5, 2023 15:29
@ande-odoo ande-odoo changed the title [FIX] website{,_sale}: sale ribbons disappearing [FIX] website_sale: sale ribbons disappearing Dec 5, 2023
@ande-odoo
Copy link
Contributor Author

After investigation, only reverting my previous PR fixes it, it probably has been fixed somewhere else in the meanwhile. I have updated this PR to only revert my previous fix.

Copy link
Contributor

@qsm-odoo qsm-odoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed 😬 What was done at 5d13fa5 should not have been merged cc @AntoineVDV

  • Template XML change in an old stable version
  • It worked before like that: the template could not have been the sole change needed

Not really a fan of changing the XML again but I guess more people are using the old version so I guess a revert 3 months later is ok.

@ande-odoo

@robodoo r+

robodoo pushed a commit that referenced this pull request Dec 11, 2023
Current behaviour:
When removing the ribbon from a product,
the other ribbons are removed as well.

Steps to reproduce:
1. Go to website
2. Go to Shop
3. Click on Edit (top right)
4. Add a ribbon to multiple products
5. Click on Save
6. Select a product with a ribbon
7. Remove the ribbon
8. (other ribbons are gone)

Cause of the issue:
Reverting fix introduced by 5d13fa5
t-out was modified into t-field to be considered dirty when modified.
but when removing a ribbon, t-field is set as empty,
which overwrites ribbons html value.

opw-3487397

closes #135908

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
@robodoo robodoo closed this Dec 11, 2023
@qsm-odoo qsm-odoo deleted the 16.0-OPW_3487397-website_sale-ribbons_disappears-ande branch December 12, 2023 08:36
@qsm-odoo
Copy link
Contributor

@ande-odoo ?

@qsm-odoo
Copy link
Contributor

qsm-odoo commented Feb 8, 2024

I guess I can forget about receiving an answer..

Testing this, I saw another bug: cannot change the ribbon colors.

Apparently solved now, maybe with the help of #152694

What happened to the change that was discussed here [...]

Created task-3734908 to handle that.

luanjubica pushed a commit to luanjubica/odoo-code that referenced this pull request Feb 14, 2024
Current behaviour:
When removing the ribbon from a product,
the other ribbons are removed as well.

Steps to reproduce:
1. Go to website
2. Go to Shop
3. Click on Edit (top right)
4. Add a ribbon to multiple products
5. Click on Save
6. Select a product with a ribbon
7. Remove the ribbon
8. (other ribbons are gone)

Cause of the issue:
Reverting fix introduced by odoo@5d13fa5
t-out was modified into t-field to be considered dirty when modified.
but when removing a ribbon, t-field is set as empty,
which overwrites ribbons html value.

opw-3487397

closes odoo#135908

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OE the report is linked to a support ticket (opw-...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants