mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-16 12:12:57 -06:00
[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.
This commit is contained in:
parent
1aff3f8493
commit
a13a1b0038
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user