mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-14 01:41:26 -06:00

Define the add attachment and add URL buttons on the same line. Allow downloading of url type attachments by clicking on the icon or the name. Define the name of the url type attachments as links (allows to open it in a new tab). Hide the download button for url attachments. Force to set mimetype to "application/link" for url attachments. Displays a link icon for url attachments. TT30263
17 lines
384 B
Python
17 lines
384 B
Python
# Copyright 2021 Tecnativa - Víctor Martínez
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
|
|
from openupgradelib import openupgrade
|
|
|
|
|
|
@openupgrade.migrate()
|
|
def migrate(env, version):
|
|
openupgrade.logged_query(
|
|
env.cr,
|
|
"""
|
|
UPDATE ir_attachment
|
|
SET mimetype = 'application/link'
|
|
WHERE type = 'link'
|
|
""",
|
|
)
|