Skip to content

Commit a10d426

Browse files
committed
[FIX] util/report: fix hyper link in migration report
step to reproduce: 1.create db in 14.0 migrate to 15.0 or onwards 2. studio view is disable somehow in migration report tag is coming as text not with hyperlink Why this is happening?. earlier t-raw is using for showing html tag same as it is but from 15 onwards t-raw is depricated t-out is in use but t-out is escape the html content during rendering and coming like this ``` &lt;a target="_blank" href="/web?debug=1#view_type=form&amp;amp;model=ir.ui.view&amp;amp;action=28&amp;amp;id=896"&gt;Odoo Studio: mrp.production.form customization&lt;/a&gt;+ ``` but it should come like this to behave correctly ``` <a target="_blank" href="http://localhost:8069/web?debug=1#view_type=form&amp;model=ir.ui.view&amp;action=28&amp;id=896">Odoo Studio: mrp.production.form customization</a> ``` after this [commit](#59) t-raw is used and t-raw is replacing [here](https://github.com/odoo/upgrade-util/blob/06085f5ed5c5d604084a5104ae82cd996e464a65/src/util/report.py#L89) as being depricated :-For fixing this issue unescape the html content before fix: ![beforei](https://github.com/odoo/upgrade-util/assets/127722128/0182a427-8411-4802-a992-f04759239b6f) after fix: ![afteri](https://github.com/odoo/upgrade-util/assets/127722128/b2058adc-9175-47df-9a24-da1e00f9a6ea) closes #64 Signed-off-by: Christophe Simonis (chs) <[email protected]>
1 parent c47b71c commit a10d426

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/util/report.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,12 @@ def ref(xid):
231231

232232
def get_anchor_link_to_record(model, id, name, action_id=None):
233233
_validate_model(model)
234-
return '<a target="_blank" href="/web?debug=1#view_type=form&amp;model=%s&amp;action=%s&amp;id=%s">%s</a>' % (
234+
anchor_tag = '<a target="_blank" href="/web?debug=1#view_type=form&amp;model=%s&amp;action=%s&amp;id=%s">%s</a>' % (
235235
model,
236236
action_id or "",
237237
id,
238238
html_escape(name),
239239
)
240+
if Markup:
241+
anchor_tag = Markup(anchor_tag)
242+
return anchor_tag

0 commit comments

Comments
 (0)