Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web_company_color/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"name": "Web Company Color",
"category": "web",
"version": "18.0.1.1.0",
"version": "18.0.1.1.1",
"author": "Alexandre Díaz, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/web",
"depends": ["web", "base_sparse_field"],
Expand Down
22 changes: 22 additions & 0 deletions web_company_color/migrations/18.0.1.1.1/post-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright NuoBiT Solutions - Eric Antones <eantones@nuobit.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
from odoo import SUPERUSER_ID, api


def migrate(cr, version):
"""Regenerate the per-company color attachments in the current format.

Databases upgraded from older versions still carry the color
attachments in the legacy format (raw SCSS content, mimetype
``application/octet-stream``). The current module compiles the SCSS
server-side and serves the attachment URL directly as a stylesheet,
so it needs compiled CSS with mimetype ``text/css`` — browsers refuse
the legacy attachments under strict MIME checking and company colors
silently stop applying. Only the ``post_init_hook`` (fresh installs)
regenerates them; upgrades never did. Idempotent: regenerating an
up-to-date attachment rewrites it with identical semantics.
"""
if not version:
return
env = api.Environment(cr, SUPERUSER_ID, {})
env["res.company"].search([]).scss_create_or_update_attachment()
Loading