mirror of
https://github.com/OCA/knowledge.git
synced 2025-12-22 13:22:19 -06:00
[FIX] document_url: Improve the definition of mimetype=application/link only to records linked to a model to avoid errors with the developer model (with assets).
This commit is contained in:
@@ -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("res_model") and values.get("res_id"):
|
||||
return "application/link"
|
||||
return super()._compute_mimetype(values)
|
||||
|
||||
Reference in New Issue
Block a user