From 54f8d34df93c69cbfae82713b7c317b044eb8032 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Wed, 8 Mar 2023 13:40:01 +0100 Subject: [PATCH] [FIX] document_url: Change mimetype only if type=url Other modules like web_pwa_oca uses url field for storing an indexed path for later being searched in the controller, so let's restrict the mimetype change if both url and type=url is set. --- document_url/models/ir_attachment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/document_url/models/ir_attachment.py b/document_url/models/ir_attachment.py index 0413ae1c..375d398e 100644 --- a/document_url/models/ir_attachment.py +++ b/document_url/models/ir_attachment.py @@ -8,6 +8,6 @@ class IrAttachment(models.Model): _inherit = "ir.attachment" def _compute_mimetype(self, values): - if values.get("url"): + if values.get("url") and values.get("type", "url") == "url": return "application/link" return super()._compute_mimetype(values)