Skip to content

[20.0][MIG] web_environment_ribbon: Migration to 20.0 - #3687

Merged
OCA-git-bot merged 93 commits into
OCA:20.0from
adhoc-dev:20.0-t-76347-vib
Oct 6, 2026
Merged

OCA-git-bot merged 93 commits into
OCA:20.0from
adhoc-dev:20.0-t-76347-vib

Conversation

@vib-adhoc

Copy link
Copy Markdown

Migration of web_environment_ribbon to 20.0.

Changes beyond the standard migration steps:

  • ir.config_parameter.get_param / set_param were removed in 20.0 (odoo/odoo@a4f2879). Replaced with get_str / set_str in the backend model and in the test.
    • When the parameter is missing, get_str returns '' instead of False. The JS component already treats both as empty, so the ribbon stays hidden as before.
    • Modules overriding _prepare_ribbon_name and comparing against False should be checked when they are migrated.

Tested on a fresh 20.0 database with demo data: the module installs, its test passes, and the ribbon shows the configured name and colors.

OpenCode and others added 30 commits October 2, 2026 09:54
ribbon_test_environment -> web_environment_ribbon
Set correct z-index on ribbon
Move position accordingly

Cf OCA#191
* [IMP] web_environment_ribbon: add color customization
The ribbon color and background-color can be modified through system
parameters:
 * ribbon.color
 * ribbon.background.color

Added Copyright in .js
Delete duplicate entries in css
By creating the ribbon div on the fly, this module doesn't depend
anymore on the webclient structure.
…(eg db_name) (OCA#621)

* [ADD] .eggs in gitignore

* [IMP] Web Environment Ribbon: add backend
This commit adds a simple bakend to facilitate inheritance

* [IMP] Web Environment Ribbon: add the databse name
This commit adds the database name under the ribbon name, in the ribbon

* [IMP] Web Environment Ribbon: prepare method for ribbon name

* [IMP] README: explain how to use db_name
* [FIX] web_environment_ribbon: Fix to show the ribbon to every non-admin user

* [FIX] web_environment_ribbon: Version number
Currently translated at 100,0% (4 of 4 strings)

Translation: web-11.0/web-11.0-web_environment_ribbon
Translate-URL: https://translation.odoo-community.org/projects/web-11-0/web-11-0-web_environment_ribbon/pt_BR/
[MIG] web_environment_ribbon: Migration to 12.0

[FIX] Default value for ribbon.name if not exists

[FIX] Hide ribbon when ribbon.name is false or not existing

[FIX] Remove copyright flag on __init__ files

[REM] Debugging logs

[REM] Make quotes inconsistant again and change sequence of data files in manifest
[UPD] Update web_environment_ribbon.pot

Update translation files

Updated by Update PO files to match POT (msgmerge) hook in Weblate.

[UPD] README.rst
Currently translated at 100.0% (4 of 4 strings)

Translation: web-12.0/web-12.0-web_environment_ribbon
Translate-URL: https://translation.odoo-community.org/projects/web-12-0/web-12-0-web_environment_ribbon/es/
Currently translated at 75.0% (3 of 4 strings)

Translation: web-12.0/web-12.0-web_environment_ribbon
Translate-URL: https://translation.odoo-community.org/projects/web-12-0/web-12-0-web_environment_ribbon/pt/
@OCA-git-bot OCA-git-bot added mod:web_environment_ribbon Module web_environment_ribbon series:20.0 labels Oct 2, 2026

@maq-adhoc maq-adhoc left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM +

@rven

rven commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

I'm getting this error when using the module in a project:

error_service.js:100 Error: Component "WebEnvironmentRibbon" defines a static "props" or "defaultProps", which Owl 3 ignores. Declare the props schema through "useProps" instead, e.g. "props = useProps({ someProp: t.string().optional(defaultValue) })".
at new Component (/web/assets/debug/web.assets_web.js:16230:19) (/web/static/src/owl2/owl3_compatibility_layer.js:45:0)
at new WebEnvironmentRibbon (/web/assets/debug/web.assets_web.js:259303:63) (/web_environment_ribbon/static/src/components/environment_ribbon/ribbon.esm.js:5:0)
at new ComponentNode (/web/assets/debug/web.assets_web.js:12744:26) (/web/static/lib/owl/owl.js:3714:0)
at /web/assets/debug/web.assets_web.js:13339:16 (/web/static/lib/owl/owl.js:4309:0)
at MainComponentsContainer.slot1 (eval at compile (owl.js:7112:1), /:14:27) (/web/static/lib/owl/owl.js:7112:0)
at callSlot (/web/assets/debug/web.assets_web.js:13083:33) (/web/static/lib/owl/owl.js:4053:0)
at ErrorHandler.__template__11 (eval at compile (/web/assets/f736590/web.assets_frontend_lazy.min.js:1587:228), /:8:12) (/web/assets/f736590/web.assets_frontend_lazy.min.js:1587:0)
at Fiber.render (/web/assets/debug/web.assets_web.js:12561:28) (/web/static/lib/owl/owl.js:3531:0)
at /web/assets/debug/web.assets_web.js:13349:17 (/web/static/lib/owl/owl.js:4319:0)
at MainComponentsContainer.__template__12 (eval at compile (owl.js:7112:1), /:29:30) (/web/static/lib/owl/owl.js:7112:0)

@pedrobaeza

Copy link
Copy Markdown
Member

/ocabot migration web_environment_ribbon

@OCA-git-bot OCA-git-bot added this to the 20.0 milestone Oct 5, 2026
@OCA-git-bot OCA-git-bot mentioned this pull request Oct 5, 2026
1 of 36 tasks
@vib-adhoc

Copy link
Copy Markdown
Author

@rven thanks for the report! Fixed: removed the static props declaration, which Owl 3 rejects. Tested on a local 20.0 database: the error is gone and the ribbon shows as expected.

@rven rven left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Also functionally tested.

@pedrobaeza pedrobaeza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code and functional review

/ocabot merge nobump

@OCA-git-bot

Copy link
Copy Markdown
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 20.0-ocabot-merge-pr-3687-by-pedrobaeza-bump-nobump, awaiting test results.

@OCA-git-bot
OCA-git-bot merged commit 2ccf570 into OCA:20.0 Oct 6, 2026
7 checks passed
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at 30a172a. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.