odoo/odoo#190142

Created by fw-bot
Merged at 55157642b4b71107b0ae722f67202016a3acd6f6

Statuses:

label
odoo-dev:18.0-17.0-url-attachment-fix-zel-4C3Q-fw
head
eaa89697041425f293c4204e46af5790b398079f
merged
10 months ago by Discuss, Zelong Lin (zel)
odoo/odoo
17.0 #187970
saas-17.2 #189080
saas-17.4 #189335
18.0 #190142
saas-18.2
saas-18.3
saas-18.4
19.0
master #190223

[FW][FIX] web,*: file viewer to show url attachment

The file viewer tries to show the document from the url obtained from the defaultSource function in file_model.js. This function builds the url using urlRoute.

Before the fix, the urlRoute is the url from the attachment. This causes the PDF viewer to fail because it has a same-origin policy.

This fix avoids to use the url to the one from the attachment's url directly so that the viewer can show the document correctly with the computed urlRoute.

The attachment url does not need to be used at all, as the odoo server will properly direct.

Forward-Port-Of: #189335
Forward-Port-Of: #187970