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:
24
document_url/migrations/14.0.1.1.0/post-migration.py
Normal file
24
document_url/migrations/14.0.1.1.0/post-migration.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# 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 = 'text/css'
|
||||
WHERE mimetype = 'application/link' AND res_id = 0 AND name LIKE '%.%css'
|
||||
""",
|
||||
)
|
||||
openupgrade.logged_query(
|
||||
env.cr,
|
||||
"""
|
||||
UPDATE ir_attachment
|
||||
SET mimetype = 'application/javascript'
|
||||
WHERE mimetype = 'application/link' AND res_id = 0 AND name LIKE '%.js'
|
||||
""",
|
||||
)
|
||||
Reference in New Issue
Block a user