Skip to content

[15.0][MIG] web_form_banner: Migration to 15.0#3287

Open
AungKoKoLin1997 wants to merge 5 commits into
OCA:15.0from
qrtl:15.0-mig-web_form_banner
Open

[15.0][MIG] web_form_banner: Migration to 15.0#3287
AungKoKoLin1997 wants to merge 5 commits into
OCA:15.0from
qrtl:15.0-mig-web_form_banner

Conversation

@AungKoKoLin1997

@AungKoKoLin1997 AungKoKoLin1997 commented Sep 16, 2025

Copy link
Copy Markdown
Contributor

Based on #3286

The module adds configurable banners for backend form views. Define rules per model
(and optionally per view) to show context-aware alerts with a chosen severity (info/warning/danger).

Messages can be plain text with ${placeholders} or fully custom HTML; visibility,
severity, and values are computed server-side via a safe Python expression.

Banners are injected just before or after a target node (default: //sheet) and refresh
on form load/save/reload.

@qrtl QT5747

@AungKoKoLin1997 AungKoKoLin1997 marked this pull request as ready for review September 17, 2025 02:59
@AungKoKoLin1997 AungKoKoLin1997 marked this pull request as draft September 22, 2025 06:03
@AungKoKoLin1997 AungKoKoLin1997 force-pushed the 15.0-mig-web_form_banner branch 2 times, most recently from f7a2d00 to 2ddbd7e Compare September 22, 2025 07:32
@AungKoKoLin1997 AungKoKoLin1997 marked this pull request as ready for review September 22, 2025 07:33
@AungKoKoLin1997 AungKoKoLin1997 marked this pull request as draft September 22, 2025 07:33
@AungKoKoLin1997 AungKoKoLin1997 marked this pull request as ready for review September 22, 2025 09:42
Comment thread web_form_banner/static/src/js/web_form_banner.esm.js Outdated
Comment thread web_form_banner/static/src/js/web_form_banner.esm.js Outdated
Comment thread web_form_banner/static/src/js/web_form_banner.esm.js Outdated
Comment thread web_form_banner/models/web_form_banner_rule.py Outdated
@yostashiro yostashiro force-pushed the 15.0-mig-web_form_banner branch 2 times, most recently from 28f0455 to 5e9cbdf Compare September 23, 2025 10:18
@yostashiro

Copy link
Copy Markdown
Member

@AungKoKoLin1997 Please confirm my commits and sort out the commit history. I think my changes can be squashed into the migration commit but comment the changed points.

@yostashiro

Copy link
Copy Markdown
Member

@AungKoKoLin1997 Can you also please switch the archive box icon to the banner?

image

@AungKoKoLin1997 AungKoKoLin1997 force-pushed the 15.0-mig-web_form_banner branch 2 times, most recently from d3c42d1 to c58a869 Compare September 25, 2025 01:49

@yostashiro yostashiro 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 review and functional test.

Comment thread web_form_banner/README.rst Outdated
@yostashiro yostashiro force-pushed the 15.0-mig-web_form_banner branch 2 times, most recently from 135d9ee to 854e4d0 Compare September 27, 2025 15:01
@AungKoKoLin1997 AungKoKoLin1997 force-pushed the 15.0-mig-web_form_banner branch 2 times, most recently from a9e5a0c to ff22e4a Compare September 29, 2025 03:10

@yostashiro yostashiro 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.

@AungKoKoLin1997 Please go ahead and squash commits.

Comment thread web_form_banner/models/web_form_banner_rule.py Outdated
Comment thread web_form_banner/models/web_form_banner_rule.py Outdated

@Sayaka-qrtl Sayaka-qrtl 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.

Functional test. LGTM

@yostashiro

Copy link
Copy Markdown
Member

@AungKoKoLin1997 Just noticed an issue with banner presentation. Can you please follow up on this?

image

@AungKoKoLin1997

Copy link
Copy Markdown
Contributor Author

Just noticed an issue with banner presentation. Can you please follow up on this?

@yostashiro Fixed it and explain the changes in the migration commit message as well.

@yostashiro yostashiro 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.

Thanks for the fix!

@AungKoKoLin1997

Copy link
Copy Markdown
Contributor Author

@yostashiro I added some changes that are to make consistent with odoo 16 changes.
Please review my last two commits.

Refactor JS:
- Switch to the ESM style
- Change var to const/let
- Remove unused parts (diff, el.dataset.wfbTriggerFields)

Miscellaneous improvements:
- list view optional
- Switch archive box icon to banner

Fix _render_html for Odoo 15:
- In Odoo 12, html_escape returned a plain string, so
  replacing newlines with <br/> worked as expected.
- In Odoo 15, html_escape uses markupsafe.escape, which
  escapes inserted <br/> tags resulting in &lt;br/&gt; in the output.
- Updated _render_html to escape each line individually
  and join with literal <br/> tags to match Odoo 12 behavior
  while remaining safe for HTML rendering.

Co-authored-by: Yoshi Tashiro <tashiro@quartile.co>
@AungKoKoLin1997 AungKoKoLin1997 force-pushed the 15.0-mig-web_form_banner branch from 9ba2e96 to f743d4f Compare October 6, 2025 09:06
- Add (partial) support for elements inside groups to be a target
  XPath without distorting the presentation
- Remove obsolete bits
- Remove lru_cache decorator

Co-authored-by: Yoshi Tashiro <tashiro@quartile.co>
@AungKoKoLin1997 AungKoKoLin1997 force-pushed the 15.0-mig-web_form_banner branch from f743d4f to deeaf64 Compare October 8, 2025 01:54

@nobuQuartile nobuQuartile 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
Functional review

@AungKoKoLin1997 AungKoKoLin1997 marked this pull request as draft May 19, 2026 01:17
@AungKoKoLin1997 AungKoKoLin1997 marked this pull request as ready for review May 25, 2026 01:31
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.

5 participants