Skip to content

Commit bf8454f

Browse files
committed
[IMP] Report custom text fields in html
1 parent 29d54b6 commit bf8454f

File tree

3 files changed

+38
-3
lines changed

3 files changed

+38
-3
lines changed

account_credit_control/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
66
{
77
"name": "Account Credit Control",
8-
"version": "18.0.2.0.0",
8+
"version": "18.0.2.1.0",
99
"author": "Camptocamp,"
1010
"Odoo Community Association (OCA),"
1111
"Okia,"
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Copyright 2020 ACSONE SA/NV
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3+
4+
from openupgradelib import openupgrade
5+
6+
7+
@openupgrade.migrate()
8+
def migrate(env, version):
9+
"""
10+
Convert custom_text fields to Html on policy_level
11+
"""
12+
if (
13+
env["credit.control.policy"]._fields["custom_text"].type != "html"
14+
and env["credit.control.policy"]._fields["custom_text_after_details"].type
15+
!= "html"
16+
):
17+
cr = env.cr
18+
openupgrade.copy_columns(
19+
cr,
20+
{
21+
"credit_control_policy_level": [
22+
("custom_text", None, None),
23+
("custom_text_after_details", None, None),
24+
]
25+
},
26+
)
27+
openupgrade.convert_field_to_html(
28+
cr, "credit_control_policy_level", "custom_text", "custom_text"
29+
)
30+
openupgrade.convert_field_to_html(
31+
cr,
32+
"credit_control_policy_level",
33+
"custom_text_after_details",
34+
"custom_text_after_details",
35+
)

account_credit_control/models/credit_control_policy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,12 +321,12 @@ class CreditControlPolicyLevel(models.Model):
321321
required=True,
322322
)
323323
channel = fields.Selection(selection=CHANNEL_LIST, required=True)
324-
custom_text = fields.Text(string="Custom Message", required=True, translate=True)
324+
custom_text = fields.Html(string="Custom Message", required=True, translate=True)
325325
mail_show_invoice_detail = fields.Boolean(string="Show Invoice Details in mail")
326326
custom_mail_text = fields.Html(
327327
string="Custom Mail Message", required=True, translate=True
328328
)
329-
custom_text_after_details = fields.Text(
329+
custom_text_after_details = fields.Html(
330330
string="Custom Message after details", translate=True
331331
)
332332

0 commit comments

Comments
 (0)