mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-17 04:32:55 -06:00
14 lines
415 B
Python
14 lines
415 B
Python
# Copyright 2021 Tecnativa - Víctor Martínez
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
|
|
|
from odoo import models
|
|
|
|
|
|
class IrAttachment(models.Model):
|
|
_inherit = "ir.attachment"
|
|
|
|
def _compute_mimetype(self, values):
|
|
if values.get("url") and values.get("res_model") and values.get("res_id"):
|
|
return "application/link"
|
|
return super()._compute_mimetype(values)
|