Skip to content

Commit 8ef18dc

Browse files
committed
[OU-ADD] account_payment_mode: Add migration scripts if it comes from 17.0
1 parent d8cdd44 commit 8ef18dc

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from openupgradelib import openupgrade
2+
3+
4+
@openupgrade.migrate()
5+
def migrate(env, version):
6+
env.cr.execute(
7+
"""
8+
SELECT
9+
id
10+
FROM account_payment_mode
11+
WHERE note::text ~* '<[^>]+>' LIMIT 1
12+
"""
13+
)
14+
if env.cr.rowcount == 0:
15+
# If there are no HTML tags in the note field, we can convert it to HTML
16+
openupgrade.convert_field_to_html(
17+
env.cr, "account_payment_mode", "note", "note", False, True
18+
)

0 commit comments

Comments
 (0)