web icon indicating copy to clipboard operation
web copied to clipboard

[16.0] web_company_color: not working if not all colors are filled

Open LauraCForgeFlow opened this issue 1 year ago • 4 comments

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:

  1. Click on the 'Compute Colors From Logo' button in 'Company Styles' (only the 3 first colors should be filled) and refresh the page.
  2. The colors on the page will stay the same, they won't change according to the company colors.
  3. 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.

LauraCForgeFlow avatar Jan 16 '24 16:01 LauraCForgeFlow

I thinks this affects more versions, the original PR is this one https://github.com/OCA/web/pull/1903.

cc @hbrunn @StefanRijnhart

LoisRForgeFlow avatar Jan 16 '24 16:01 LoisRForgeFlow

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?

peterromao avatar Jan 29 '24 18:01 peterromao

@hbrunn your feedback would be really appreciated here.

Thanks!

LoisRForgeFlow avatar Feb 07 '24 10:02 LoisRForgeFlow

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

hbrunn avatar Feb 12 '24 09:02 hbrunn

This seems to have been fixed in https://github.com/OCA/web/pull/2902.

@LauraCForgeFlow I think we can close the issue

LoisRForgeFlow avatar Dec 18 '24 12:12 LoisRForgeFlow