Hello Guillaume!
I also faced the same issue, where I needed to create a specific `theme_NAME` module to render the `scss` files. The solution I found was the following:
- This error occurs because the `primary_variables.scss` file is being loaded before `bootstrap_overridden.scss`. The solution is to adjust the order in the `__manifest__.py` file, placing the path of the `bootstrap_overridden.scss` file before `primary_variables.scss`. After that, restart Odoo and update the module. With this, the error will no longer appear in the log, but still, the `scss` files will not render correctly. This brings us to the second point.
- Check the pre-existing themes in the `ir_asset.xml` file in the `data` directory, as only the `bootstrap_overridden.scss` file is being added with the `prepend` directive. Remove the `prepend` directive from the `primary_variables.scss` file path in the `__manifest__.py` file, restart Odoo and update the module.
This fix confirms that the issue was related to the loading order with `prepend`. When `primary_variables.scss` was loaded before Bootstrap, via `prepend`, it would try to modify `$o-color-palettes` before this value was set, causing a silent failure.
Result:
'assets': {
'web._assets_frontend_helpers': [
('prepend', 'website_NAME/static/src/scss/bootstrap_overridden.scss')
],
'web._assets_primary_variables': [
'website_NAME/static/src/scss/primary_variables.scss'
],
'web.assets_frontend': [
'website_NAME/static/src/scss/theme_style.scss'
]
}
I hope this solution can help you, as well as other professionals who may be facing the same problem.