[16.0] web_company_color: not working if not all colors are filled
Module
web_company_color
Describe the bug
If not all company colors are filled, then the colors which are filled do not get applied to the company's page.
To Reproduce
Affected versions: 16.0
Steps to reproduce the behavior:
- Click on the 'Compute Colors From Logo' button in 'Company Styles' (only the 3 first colors should be filled) and refresh the page.
- The colors on the page will stay the same, they won't change according to the company colors.
- If we look a the Odoo logs, we will be able to see a warning similar to this, since it does not recognise 'theme-color("primary")' as a color:
Error: argument `$color` of `darken($color, $amount)` must be a color
on line 41:18 of stdin, in function `darken`
from line 41:18 of stdin
>> color: darken(theme-color("primary"), 10%) !important;
Expected behavior The colors of the page should change according to the company colors, and not throw the previously mentioned warning. This should happen even if not all colors are filled.
Additional context This problem was introduced in PR #2534 (by @aleuffre), at least in version 16.0.
I thinks this affects more versions, the original PR is this one https://github.com/OCA/web/pull/1903.
cc @hbrunn @StefanRijnhart
On v16 I confirm this and I think there should be a way to revert to odoo's original color scheme. Also color_link_test seems to be changing the menu text colors in some menus, but probably in some modules that do not follow correct css linking of attributes. Also is there a way to define a color as alpha? Empty?
@hbrunn your feedback would be really appreciated here.
Thanks!
that's simply a case of a wrong migration that has been merged without enough testing, nothing to do with me or earlier versions.
The scss function theme-color has been deprecated, this needs to be replaced with map-get($theme-colors, 'primary') in v16
This seems to have been fixed in https://github.com/OCA/web/pull/2902.
@LauraCForgeFlow I think we can close the issue