Skip to content

[19.0][FIX] web_company_color: make company colours work in Odoo 19 - #3750

Closed
Yasirkk5 wants to merge 2 commits into
OCA:19.0from
Yasirkk5:19.0-fix-web_company_color-odoo19
Closed

Yasirkk5 wants to merge 2 commits into
OCA:19.0from
Yasirkk5:19.0-fix-web_company_color-odoo19

Conversation

@Yasirkk5

Copy link
Copy Markdown

Requested by yasir

The 19.0 migration of web_company_color kept the 16.0 stylesheet. In Odoo 19 most of those selectors no longer match, so the colours a company sets only partly apply. The rest of the UI keeps Odoo's purple: smart buttons, the statusbar, selected list rows, focus rings, switches, the open Filters toggle, the date picker and others.

What this changes

  • Odoo 19 CSS variables: the navbar, buttons, links, statusbar, selected list rows, smart buttons and inputs now set the variables Odoo 19 reads (--NavBar-*, --btn-*, --link-color, --o-stat-*, --o-input-border-color, …). They no longer override rules that Odoo 19 doesn't use.
  • Plain CSS: the generated stylesheet has no Sass nesting, so it is valid as served.
  • Only configured groups: a company is styled only for the colour groups it sets (navbar, buttons, links, submenu). Empty hover and text colours are derived from the chosen colour, not from purple.
  • Brand-colour coverage: the other web/Bootstrap widgets that Odoo compiles with its brand colour are now covered. These include focus rings, switches, open search toggles, the date picker, pagination, progress bars, kanban and settings highlights, and properties fields.
  • No cross-company leaks: the company stylesheet link is built per request. Before, the cached asset links were modified in place, so one company's colours could show up for another company.
  • Phone toolbar: the theme-color meta tag follows the navbar colour.
  • Logo detection: colour detection no longer crashes on fully white, black or transparent logos.
  • Company form: the existing Submenu Text Color field is now shown.
  • CSS variables for other modules (second commit, [IMP]): the company palette is published as --web-company-color-primary and --web-company-color-primary-hover, so other modules can follow the company theme.

A 19.0.1.1.0 migration regenerates existing company stylesheets. Saved colours are kept.

How to test

  1. Set different navbar, button and link colours on two companies.
  2. Switch between the companies and check that only the active company's colours apply.
  3. Check these screens: a form with smart buttons and a statusbar, a list with rows selected, the search bar with Filters open, a date field, and a form with a many2one dropdown open.
  4. Clear all colours on a company and check that it returns to the standard Odoo look.

Screenshots

Before/after screenshots will follow in a comment.

🤖 Generated with Claude Code

Yasirkk5 and others added 2 commits October 23, 2026 12:20
The 19.0 migration kept the 16.0 stylesheet, which Odoo 19 no longer
matches:

- Navbar, buttons, links, statusbar, selected list rows, smart buttons
  and inputs now set the CSS variables Odoo 19 reads (--NavBar-*,
  --btn-*, --link-color, --o-stat-*, --o-input-border-color, ...)
  instead of overriding rules Odoo 19 no longer uses.
- The generated stylesheet is plain CSS (no nesting), so it is valid
  without Sass compilation.
- Only the colour groups a company sets are styled; empty hover and
  text colours are derived from the chosen colour instead of purple.
- Cover the other widgets Odoo compiles with its brand colour (focus
  rings, switches, open search toggles, date picker, pagination,
  progress bars, kanban/settings highlights, properties fields, ...).
- Company stylesheet links are built per request; mutating the cached
  asset links leaked one company's colours into other companies.
- Phone browser toolbar (theme-color) follows the navbar colour.
- Logo colour detection no longer crashes on fully white, black or
  transparent logos.
- Expose the submenu colour field in the company form.

The migration regenerates existing stylesheets; saved colours are kept.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Publish the active company's button colours as
--web-company-color-primary and --web-company-color-primary-hover so
other modules can follow the company theme from their own stylesheets,
with their usual colour as fallback.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@pedrobaeza

Copy link
Copy Markdown
Member

Check https://github.com/pypa/pip/blob/main/AI_POLICY.md to perform the needed changes

@Yasirkk5 Yasirkk5 closed this Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:web_company_color Module web_company_color series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants