File tree Expand file tree Collapse file tree
openupgrade_scripts/scripts/website/18.0.1.0 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Copyright 2026 Tecnativa - Pilar Vargas
2+ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+ from openupgradelib import openupgrade
5+
6+
7+ def migrate_s_carousel_snippets (env ):
8+ openupgrade .logged_query (
9+ env .cr ,
10+ r"""
11+ UPDATE ir_ui_view v
12+ SET arch_db = data.arch_db
13+ FROM (
14+ SELECT view.id,
15+ jsonb_object_agg(
16+ lang,
17+ regexp_replace(
18+ arch,
19+ $$<section(?=[^>]*class="[^"]*s_carousel_wrapper[^"]*")(?![^>]*data-vcss=)[^>]*>$$,
20+ $$\& data-vcss="001"$$,
21+ 'g'
22+ )
23+ ) AS arch_db
24+ FROM ir_ui_view view
25+ CROSS JOIN LATERAL jsonb_each_text(view.arch_db) AS value(lang, arch)
26+ WHERE view.website_id IS NOT NULL
27+ AND view.arch_db::text LIKE '%s_carousel_wrapper%'
28+ GROUP BY view.id
29+ ) data
30+ WHERE v.id = data.id
31+ """ ,
32+ )
33+
34+
35+ @openupgrade .migrate ()
36+ def migrate (env , version ):
37+ migrate_s_carousel_snippets (env )
You can’t perform that action at this time.
0 commit comments