Skip to content

Commit 28ce031

Browse files
[REF] runbot: replace t-esc with t-out
t-esc has been deprecated and uses redirects to t-out anyways, removing since in dev mode it logs a warning in the terminal. See odoo/odoo#81024
1 parent 01e7676 commit 28ce031

17 files changed

+242
-242
lines changed

forwardport/data/views.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
])"/>
1616
<div t-if="outstanding != 0" class="alert col-md-12 alert-warning mb-0">
1717
<a href="/forwardport/outstanding">
18-
<t t-esc="outstanding"/> outstanding forward-ports (>1 week)
18+
<t t-out="outstanding"/> outstanding forward-ports (>1 week)
1919
</a>
2020
</div>
2121
</t>

runbot/static/src/js/fields/fields.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function stringify(obj) {
2323
export class JsonField extends TextField {
2424
static template = xml`
2525
<t t-if="props.readonly">
26-
<span t-esc="value"/>
26+
<span t-out="value"/>
2727
</t>
2828
<t t-else="">
2929
<div t-ref="div">
@@ -64,7 +64,7 @@ registry.category("fields").add("runbotjsonb", {
6464

6565
export class FrontendUrl extends Component {
6666
static template = xml`
67-
<div><a t-att-href="route" target="_blank"><t t-esc="displayValue"/></a></div>
67+
<div><a t-att-href="route" target="_blank"><t t-out="displayValue"/></a></div>
6868
`;
6969

7070
static components = { Many2OneField };

runbot/static/src/js/fields/tracking_value.xml

+7-7
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,24 @@
99
<button class="btn btn-sm btn-outline-primary" t-on-click="toggleKept">Toggle context</button>
1010
<button class="btn btn-sm btn-outline-primary" t-on-click="copyNewToClipboard(trackingValue)">Copy new value to clipboard</button>
1111
</div>
12-
<div class="o-mail-Message-trackingField ms-1 fst-italic text-muted">(<t t-esc="trackingValue.changedField"/>)</div>
12+
<div class="o-mail-Message-trackingField ms-1 fst-italic text-muted">(<t t-out="trackingValue.changedField"/>)</div>
1313
<div class="code_diff">
1414
<table>
1515
<t t-foreach="lines(trackingValue)" t-as="line" t-key="line_index">
1616
<tr t-if="kept or line.type!=='kept'">
17-
<td class="col_number" t-esc="line.pre_line_counter"/>
18-
<td class="col_number" t-esc="line.post_line_counter"/>
19-
<td class="code" t-att-class="line.type" t-esc="line.line"/>
17+
<td class="col_number" t-out="line.pre_line_counter"/>
18+
<td class="col_number" t-out="line.post_line_counter"/>
19+
<td class="code" t-att-class="line.type" t-out="line.line"/>
2020
</tr>
2121
</t>
2222
</table>
2323
</div>
2424
</t>
2525
<t t-else="">
26-
<span class="o-mail-Message-trackingOld me-1 px-1 text-muted fw-bold" t-esc="formatTrackingOrNone(trackingValue.fieldType, trackingValue.oldValue)"/>
26+
<span class="o-mail-Message-trackingOld me-1 px-1 text-muted fw-bold" t-out="formatTrackingOrNone(trackingValue.fieldType, trackingValue.oldValue)"/>
2727
<i class="o-mail-Message-trackingSeparator fa fa-long-arrow-right mx-1 text-600"/>
28-
<span class="o-mail-Message-trackingNew me-1 fw-bold text-info" t-esc="formatTrackingOrNone(trackingValue.fieldType, trackingValue.newValue)"/>
29-
<span class="o-mail-Message-trackingField ms-1 fst-italic text-muted">(<t t-esc="trackingValue.changedField"/>)</span>
28+
<span class="o-mail-Message-trackingNew me-1 fw-bold text-info" t-out="formatTrackingOrNone(trackingValue.fieldType, trackingValue.newValue)"/>
29+
<span class="o-mail-Message-trackingField ms-1 fst-italic text-muted">(<t t-out="trackingValue.changedField"/>)</span>
3030
</t>
3131
</li>
3232
</xpath>

runbot/templates/badge.xml

+8-8
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
<rect t-att-x="left.width" width="4" height="18" t-att-fill="right.color"/>
1616
<rect rx="4" t-attf-width="{{ left.width + right.width }}" height="18" fill="url(#smooth)"/>
1717
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
18-
<text t-attf-x="{{left.width/2+1}}" y="13" fill="#010101" fill-opacity=".3"><t t-esc="left.text"/></text>
19-
<text t-attf-x="{{left.width/2+1}}" y="12"><t t-esc="left.text"/></text>
20-
<text t-attf-x="{{left.width+right.width/2-1}}" y="13" fill="#010101" fill-opacity=".3"><t t-esc="right.text"/></text>
21-
<text t-attf-x="{{left.width+right.width/2-1}}" y="12"><t t-esc="right.text"/></text>
18+
<text t-attf-x="{{left.width/2+1}}" y="13" fill="#010101" fill-opacity=".3"><t t-out="left.text"/></text>
19+
<text t-attf-x="{{left.width/2+1}}" y="12"><t t-out="left.text"/></text>
20+
<text t-attf-x="{{left.width+right.width/2-1}}" y="13" fill="#010101" fill-opacity=".3"><t t-out="right.text"/></text>
21+
<text t-attf-x="{{left.width+right.width/2-1}}" y="12"><t t-out="right.text"/></text>
2222
</g>
2323
</svg>
2424
</template>
@@ -36,10 +36,10 @@
3636
<rect t-att-x="left.width" width="4" height="20" t-att-fill="right.color"/>
3737
<rect rx="3" t-attf-width="{{ left.width + right.width }}" height="20" fill="url(#smooth)"/>
3838
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
39-
<text t-attf-x="{{left.width/2+1}}" y="15" fill="#010101" fill-opacity=".3"><t t-esc="left.text"/></text>
40-
<text t-attf-x="{{left.width/2+1}}" y="14"><t t-esc="left.text"/></text>
41-
<text t-attf-x="{{left.width+right.width/2-1}}" y="15" fill="#010101" fill-opacity=".3"><t t-esc="right.text"/></text>
42-
<text t-attf-x="{{left.width+right.width/2-1}}" y="14"><t t-esc="right.text"/></text>
39+
<text t-attf-x="{{left.width/2+1}}" y="15" fill="#010101" fill-opacity=".3"><t t-out="left.text"/></text>
40+
<text t-attf-x="{{left.width/2+1}}" y="14"><t t-out="left.text"/></text>
41+
<text t-attf-x="{{left.width+right.width/2-1}}" y="15" fill="#010101" fill-opacity=".3"><t t-out="right.text"/></text>
42+
<text t-attf-x="{{left.width+right.width/2-1}}" y="14"><t t-out="right.text"/></text>
4343
</g>
4444
</svg>
4545
</template>

runbot/templates/batch.xml

+25-25
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<tr>
1111
<td>Bundle</td>
1212
<td>
13-
<a t-esc="batch.bundle_id.name" t-attf-href="/runbot/bundle/{{batch.bundle_id.id}}"/>
13+
<a t-out="batch.bundle_id.name" t-attf-href="/runbot/bundle/{{batch.bundle_id.id}}"/>
1414
&amp;emsp;
1515
<a groups="runbot.group_runbot_advanced_user" t-attf-href="/web/#id={{batch.id}}&amp;view_type=form&amp;model=runbot.batch&amp;menu_id={{env['ir.model.data']._xmlid_to_res_id('runbot.runbot_menu_root')}}" class="btn btn-default btn-sm" target="new" title="View Batch in Backend">
1616
<i class="fa fa-list"/>
@@ -19,28 +19,28 @@
1919
</tr>
2020
<tr t-if="batch.category_id.id != default_category">
2121
<td>Category</td>
22-
<td t-esc="batch.category_id.name"></td>
22+
<td t-out="batch.category_id.name"></td>
2323
</tr>
2424
<tr>
2525
<td>Version</td>
26-
<td t-esc="batch.slot_ids[0].params_id.version_id.name if batch.slot_ids else batch.bundle_id.version_id.name"/>
26+
<td t-out="batch.slot_ids[0].params_id.version_id.name if batch.slot_ids else batch.bundle_id.version_id.name"/>
2727
</tr>
2828
<tr>
2929
<td>Create date</td>
30-
<td t-esc="batch.create_date"/>
30+
<td t-out="batch.create_date"/>
3131
</tr>
3232
<tr t-if="more">
3333
<td>Last update</td>
3434
<td>
35-
<t t-esc="batch.last_update"/>
36-
<span class="badge text-bg-info" t-esc="s2human(batch.last_update - batch.create_date)"/>
35+
<t t-out="batch.last_update"/>
36+
<span class="badge text-bg-info" t-out="s2human(batch.last_update - batch.create_date)"/>
3737
</td>
3838
</tr>
3939
<tr t-if="more and batch.reference_batch_ids">
4040
<td>Version reference batches (for upgrade)</td>
4141
<td>
4242
<t t-foreach="batch.reference_batch_ids" t-as="reference_batch"/>
43-
<div><a t-attf-href="/runbot/batch/{{reference_batch.id}}"><t t-esc="reference_batch.bundle_id.version_id.name"/> (<t t-esc="reference_batch.id"/>)</a></div>
43+
<div><a t-attf-href="/runbot/batch/{{reference_batch.id}}"><t t-out="reference_batch.bundle_id.version_id.name"/> (<t t-out="reference_batch.id"/>)</a></div>
4444
</td>
4545
</tr>
4646
<tr>
@@ -54,63 +54,63 @@
5454
<i class="fa fa-fw fa-link" t-if="commit_link.match_type == 'head'" title="This commit is an existing head from bundle branches"/>
5555
<i class="fa fa-fw fa-code-fork" t-if="commit_link.match_type == 'base_match'" title="This commit is matched from a base batch with matching merge_base"/>
5656
<i class="fa fa-fw fa-clock-o" t-if="commit_link.match_type == 'base_head'" title="This commit is the head of a base branch"/>
57-
<span class="label" t-esc="commit.dname"/>
57+
<span class="label" t-out="commit.dname"/>
5858
</a>
5959
<a t-att-href="'https://%s/commit/%s' % (commit_link.branch_id.remote_id.base_url, commit_link.commit_id.name)" title="View Commit on Github"><i class="fa fa-github"/></a>
6060
<small t-if="commit_link.match_type and commit_link.match_type.startswith('base')">
6161
from base:
62-
<span t-esc="commit_link.branch_id.name"/>
62+
<span t-out="commit_link.branch_id.name"/>
6363
<br/>
6464
</small>
6565
<small t-else="">
6666
found in branch
67-
<span t-esc="commit_link.branch_id.name"/>
67+
<span t-out="commit_link.branch_id.name"/>
6868
<t t-if="batch.state != 'preparing'">
69-
<span t-esc="'+%s' % commit_link.diff_add" class="text-success"/>
70-
<span t-esc="'-%s' % commit_link.diff_remove" class="text-danger"/>
69+
<span t-out="'+%s' % commit_link.diff_add" class="text-success"/>
70+
<span t-out="'-%s' % commit_link.diff_remove" class="text-danger"/>
7171
<span class="text-info">
7272
(
73-
<span t-esc="commit_link.file_changed"/>
73+
<span t-out="commit_link.file_changed"/>
7474
<i class="fa fa-file"/>
7575
)
7676
<span io="behind">(
77-
<span t-esc="'%s ahead' % commit_link.base_ahead" class="text-success"/>
77+
<span t-out="'%s ahead' % commit_link.base_ahead" class="text-success"/>
7878
,
79-
<span t-esc="'%s behind' % commit_link.base_behind" class="text-danger"/>
79+
<span t-out="'%s behind' % commit_link.base_behind" class="text-danger"/>
8080
)</span>
8181
</span>
8282
</t>
8383
<br/>
8484
<t t-if="more">
8585
Base head:
86-
<span t-esc="commit_link.base_commit_id.name"/>
86+
<span t-out="commit_link.base_commit_id.name"/>
8787
<br/>
8888
Merge base:
89-
<span t-esc="commit_link.merge_base_commit_id.name"/>
89+
<span t-out="commit_link.merge_base_commit_id.name"/>
9090
<br/>
9191
</t>
9292
</small>
93-
<b t-if="commit.rebase_on_id">Automatic rebase on <t t-esc="commit.rebase_on_id.name"/><br/></b>
93+
<b t-if="commit.rebase_on_id">Automatic rebase on <t t-out="commit.rebase_on_id.name"/><br/></b>
9494
<t t-if="more or not (commit_link.match_type and commit_link.match_type.startswith('base'))">
9595
Subject:
96-
<span t-esc="commit.subject"/>
96+
<span t-out="commit.subject"/>
9797
<br/>
9898
Author:
99-
<span t-esc="commit.author"/>
99+
<span t-out="commit.author"/>
100100
(
101-
<span t-esc="commit.author_email"/>
101+
<span t-out="commit.author_email"/>
102102
)
103103
<br/>
104104
<t t-if="commit.author != commit.committer">
105105
Committer:
106-
<span t-esc="commit.committer"/>
106+
<span t-out="commit.committer"/>
107107
(
108-
<span t-esc="commit.committer_email"/>
108+
<span t-out="commit.committer_email"/>
109109
)
110110
<br/>
111111
</t>
112112
Commit date:
113-
<span t-esc="commit.date"/>
113+
<span t-out="commit.date"/>
114114
<br/>
115115
</t>
116116
<hr/>
@@ -155,7 +155,7 @@
155155
<t t-foreach="batch.log_ids" t-as="log">
156156
<t t-set="logclass" t-value="dict(ERROR='danger', WARNING='warning', INFO='info').get(log.level, 'warning')"/>
157157
<div t-attf-class="alert alert-{{logclass}}">
158-
<b t-esc="log.level"/>
158+
<b t-out="log.level"/>
159159
--
160160
<t t-out="log._markdown()"/>
161161
</div>

0 commit comments

Comments
 (0)