Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion account_credit_control/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Account Credit Control",
"version": "18.0.2.0.0",
"version": "18.0.2.1.0",
"author": "Camptocamp,"
"Odoo Community Association (OCA),"
"Okia,"
Expand Down
35 changes: 35 additions & 0 deletions account_credit_control/migrations/18.0.2.1.0/post-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright 2020 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from openupgradelib import openupgrade


@openupgrade.migrate()
def migrate(env, version):
"""
Convert custom_text fields to Html on policy_level
"""
if (
env["credit.control.policy.level"]._fields["custom_text"].type != "html"
and env["credit.control.policy.level"]._fields["custom_text_after_details"].type
!= "html"
):
cr = env.cr
openupgrade.copy_columns(
cr,
{
"credit_control_policy_level": [
("custom_text", None, None),
("custom_text_after_details", None, None),
]
},
)
openupgrade.convert_field_to_html(
cr, "credit_control_policy_level", "custom_text", "custom_text"
)
openupgrade.convert_field_to_html(
cr,
"credit_control_policy_level",
"custom_text_after_details",
"custom_text_after_details",
)
4 changes: 2 additions & 2 deletions account_credit_control/models/credit_control_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,12 +321,12 @@ class CreditControlPolicyLevel(models.Model):
required=True,
)
channel = fields.Selection(selection=CHANNEL_LIST, required=True)
custom_text = fields.Text(string="Custom Message", required=True, translate=True)
custom_text = fields.Html(string="Custom Message", required=True, translate=True)
mail_show_invoice_detail = fields.Boolean(string="Show Invoice Details in mail")
custom_mail_text = fields.Html(
string="Custom Mail Message", required=True, translate=True
)
custom_text_after_details = fields.Text(
custom_text_after_details = fields.Html(
string="Custom Message after details", translate=True
)

Expand Down