odoo/odoo#203966

Created by fw-bot
Merged at 714feee7616eee551e5b505211b9b08986d8f88b

Statuses:

label
odoo-dev:saas-18.2-master-fix-masonry-block-alt-snippets-dery-421167-fw
head
de08f3685a5e80b1814360eee9779cf731f55c8e
merged
2 months ago by Website, Quentin Smetz (qsm)
odoo/odoo
18.0 #195406
saas-18.1 #200690
saas-18.2 #203966
saas-18.3
master #203976

[FW][FIX] web_editor: improve automatic addition of data-snippet

In [1], the masonry_block snippet has been exploded into multiple 'sub-snippet'. But this had for consequence that when selecting a block of the snippet one too many option section was appearing because of this multiple level snippet.
(e.g: s_masonry_block > s_masonry_block_default_template > Block) Yet this middle level has no options on its own. so it was unnecessary to have an options section for the 'sub-snippets'. This commit just prevent to be able to select the 'sub-snippets'.

Furthermore, due to those 'sub-snippets' being contained inside the s_masonry_block snippet, they would not get registered in the list of all the snippets, and then the website would failed to determine their version which raised the 'outdated_snippet' alert. Preventing the selection of those 'sub-snippet' thus also prevent the website checking their version.
As of now none of these sub-snippets have different version than the basic s_masonry_block so I guess we can just ignore that since they are not designed to change from the basic s_masonry_block options. And if so should happen in the future they would probably become completely independant snippets.

Steps to reproduce :

  • Enter edit mode
  • Drag and drop a s_masonry_block snippet
  • Select one of the blocks of the snippets
  • On the options panel an errored 'Block' option section appeared.
  • Click on 'access options anyway', the section is then empty.

[1] : #183755

task-4508767

Forward-Port-Of: #200690
Forward-Port-Of: #195406