odoo/odoo#189335

Created by fw-bot
Merged at 321eda23968f243e20fa7f167ba21dde28bbdfb5

Statuses:

label
odoo-dev:saas-17.4-17.0-url-attachment-fix-zel-HAeT-fw
head
96f89670e3c90d74f4459cc8321c909e1d684330
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: #189080
Forward-Port-Of: #187970