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+ env .cr .execute (
9+ """
10+ UPDATE ir_ui_view v
11+ SET arch_db = data.arch_db
12+ FROM (
13+ SELECT view.id,
14+ jsonb_object_agg(
15+ lang,
16+ regexp_replace(
17+ arch,
18+ $$<section(?=[^>]*class="[^"]*s_carousel_wrapper[^"]*")(?![^>]*data-vcss=)[^>]*>$$,
19+ $$\& data-vcss="001"$$,
20+ 'g'
21+ )
22+ ) AS arch_db
23+ FROM ir_ui_view view
24+ CROSS JOIN LATERAL jsonb_each_text(view.arch_db) AS value(lang, arch)
25+ WHERE view.website_id IS NOT NULL
26+ AND view.arch_db::text LIKE '%s_carousel_wrapper%'
27+ GROUP BY view.id
28+ ) data
29+ WHERE v.id = data.id
30+ """
31+ )
32+
33+
34+ @openupgrade .migrate ()
35+ def migrate (env , version ):
36+ migrate_s_carousel_snippets (env )
You can’t perform that action at this time.
0 commit comments