mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-24 09:28:42 -06:00
commit
b126874867
@ -2,7 +2,7 @@
|
|||||||
# Copyright 2020 Tecnativa - Manuel Calero
|
# Copyright 2020 Tecnativa - Manuel Calero
|
||||||
{
|
{
|
||||||
"name": "URL attachment",
|
"name": "URL attachment",
|
||||||
"version": "14.0.1.0.0",
|
"version": "14.0.1.1.0",
|
||||||
"category": "Tools",
|
"category": "Tools",
|
||||||
"author": "Tecnativa, Odoo Community Association (OCA)",
|
"author": "Tecnativa, Odoo Community Association (OCA)",
|
||||||
"website": "https://github.com/OCA/knowledge",
|
"website": "https://github.com/OCA/knowledge",
|
||||||
|
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'
|
||||||
|
""",
|
||||||
|
)
|
@ -8,6 +8,6 @@ class IrAttachment(models.Model):
|
|||||||
_inherit = "ir.attachment"
|
_inherit = "ir.attachment"
|
||||||
|
|
||||||
def _compute_mimetype(self, values):
|
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 "application/link"
|
||||||
return super()._compute_mimetype(values)
|
return super()._compute_mimetype(values)
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
<link
|
<link
|
||||||
href="/document_url/static/src/scss/document_url.scss"
|
href="/document_url/static/src/scss/document_url.scss"
|
||||||
rel="stylesheet"
|
rel="stylesheet"
|
||||||
|
type="text/scss"
|
||||||
/>
|
/>
|
||||||
</xpath>
|
</xpath>
|
||||||
</template>
|
</template>
|
||||||
|
Loading…
Reference in New Issue
Block a user