Skip to content

Commit

Permalink
[IMP] account_payment_mode: change type of payment_mode.note field fr…
Browse files Browse the repository at this point in the history
…om Text to Html

also add migration script
  • Loading branch information
clementthomas committed Oct 3, 2024
1 parent 5329636 commit 7a6f72c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions account_payment_mode/migrations/16.0.2.0.0/post-migrate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

import logging

from openupgradelib import openupgrade

_logger = logging.getLogger(__name__)


@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
)
2 changes: 1 addition & 1 deletion account_payment_mode/models/account_payment_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 7a6f72c

Please sign in to comment.