[FW][FIX] web_editor: fix popup with invisible elements
Steps to reproduce the bug:
- In Website edit mode.
- Drag and drop a "Popup" into the page.
- Drag and drop a "Text" block into the page (note that the "Text" block must be dropped after the "Popup" for the bug to occur).
- Enable the "Hide on desktop" option for the "Text" block.
- There are now 2 elements in the "Invisible Elements" list of the snippet menu. They should be ordered as follows: "Popup" and below "Text".
- Save the page.
- Enter edit mode.
- Click on "Popup" in the "Invisible Elements" list of the snippet menu.
- Bug: a traceback occurs.
When we add options for a snippet, we also add the options of its parent snippets. But for "Popup" snippets, since commit 2, we don’t want to add their parent options. So, we don’t create an editor for the parents of a "Popup."
However, when adding the "Popup" options to the snippet menu, we still check if an editor exists for its parents to decide whether to add parent options. The problem is that an editor for one of the parents might have started being created for another snippet that shares the same parent, but the creation is not finished yet, which causes the bug.
To fix this, this commit stops adding parent options for snippets that shouldn’t have a parent editor (as required by commit 2).
Note that commit 2 was introduced in version 15, but the bug only appears in version 17.4, following commit 1, which converted the snippet menu to OWL.
opw-4217635 opw-4217256 opw-4190303 opw-4151866 opw-4221894 opw-4206875 opw-4127338
Forward-Port-Of: odoo/odoo#182768
This PR targets 18.0 and is part of the forward-port chain. Further PRs will be created up to master.
More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port
