From 1dd87a0001180ccbbf63c213867433c49f42d6c8 Mon Sep 17 00:00:00 2001 From: clementthomas Date: Thu, 26 Sep 2024 14:54:36 +0200 Subject: [PATCH] [IMP] account_payment_mode: change type of payment_mode.note field from Text to Html also add migration script --- .../migrations/16.0.2.0.0/post-migrate.py | 11 +++++++++++ account_payment_mode/models/account_payment_mode.py | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 account_payment_mode/migrations/16.0.2.0.0/post-migrate.py diff --git a/account_payment_mode/migrations/16.0.2.0.0/post-migrate.py b/account_payment_mode/migrations/16.0.2.0.0/post-migrate.py new file mode 100644 index 000000000000..5e1eb627d96d --- /dev/null +++ b/account_payment_mode/migrations/16.0.2.0.0/post-migrate.py @@ -0,0 +1,11 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + """Migrate note field from Text to Html""" + openupgrade.convert_field_to_html( + env.cr, "account_payment_mode", "note", "note", False, True + ) diff --git a/account_payment_mode/models/account_payment_mode.py b/account_payment_mode/models/account_payment_mode.py index 5fed3d834386..62ac540e1456 100644 --- a/account_payment_mode/models/account_payment_mode.py +++ b/account_payment_mode/models/account_payment_mode.py @@ -67,7 +67,7 @@ class AccountPaymentMode(models.Model): related="payment_method_id.code", readonly=True, store=True ) active = fields.Boolean(default=True) - note = fields.Text(translate=True) + note = fields.Html(translate=True) sequence = fields.Integer(default=10) @api.onchange("company_id")