Skip to content

Commit 6d1d33f

Browse files
[OU-IMP] website: migrate s_carousel snippets
Add missing data-vcss="001" to migrated s_carousel snippets. TT63052
1 parent 6b4ed70 commit 6d1d33f

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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)

0 commit comments

Comments
 (0)