Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

AungKoKoLin1997
Copy link
Contributor

@AungKoKoLin1997 AungKoKoLin1997 commented Oct 1, 2025

Based on #3287

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

yostashiro and others added 4 commits September 29, 2025 08:17
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

Co-authored-by: Yoshi Tashiro <[email protected]>
@AungKoKoLin1997 AungKoKoLin1997 force-pushed the 16.0-mig_web_form_banner branch 4 times, most recently from 460f85a to 5c4a2a1 Compare October 2, 2025 04:18
@AungKoKoLin1997 AungKoKoLin1997 marked this pull request as ready for review October 2, 2025 04:21
@bealdav
Copy link
Member

bealdav commented Oct 3, 2025

Hi @AungKoKoLin1997 and @yoshiro Thanks a lot for your nice module.
I'm asking myself if there is no way to have no js code and just python code.
I suppose with python, migration over versions could be more easy.
Yes it require to save page to evaluate python code but I suppose that's not an hard inconvenient

@yostashiro yostashiro force-pushed the 16.0-mig_web_form_banner branch 2 times, most recently from b3c8879 to 222232f Compare October 5, 2025 14:58
@yostashiro
Copy link
Member

Thanks @bealdav !

We'd also prefer to minimize JS, but dynamic banner updates are a hard requirement from a client, and I'm sure some people will find it useful as well. I also assume that JS changes required in future migrations will be relatively limited after this version.

We still need to tidy up the commits, but the code is ready for review! :)

@AungKoKoLin1997 AungKoKoLin1997 force-pushed the 16.0-mig_web_form_banner branch from 222232f to 5ead4c3 Compare October 6, 2025 02:59
Copy link
Member

@yostashiro yostashiro left a comment

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.

@bealdav
Copy link
Member

bealdav commented Oct 6, 2025

Thanks a lot @yostashiro for your answer. Do you plan to port this module to upper version like 18.0 ?

Copy link
Member

@bealdav bealdav left a comment

Choose a reason for hiding this comment

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

Functionnaly tested, thanks a lot.

@AungKoKoLin1997
Copy link
Contributor Author

Do you plan to port this module to upper version like 18.0 ?

@bealdav Yes, we plan to migrate to v17 and v18 in the next couple of days.

- Add (partial) support for elements inside groups to be a target
  XPath without distorting the presentation
- Remove obsolete bits
- Remove lru_cache decorator
@AungKoKoLin1997 AungKoKoLin1997 force-pushed the 16.0-mig_web_form_banner branch from 5ead4c3 to 85f01b3 Compare October 8, 2025 01:51
@legalsylvain
Copy link
Contributor

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 16.0-ocabot-merge-pr-3298-by-legalsylvain-bump-nobump, awaiting test results.

OCA-git-bot added a commit that referenced this pull request Oct 8, 2025
Signed-off-by legalsylvain
@OCA-git-bot
Copy link
Contributor

It looks like something changed on 16.0 in the meantime.
Let me try again (no action is required from you).
Prepared branch 16.0-ocabot-merge-pr-3298-by-legalsylvain-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit fbdbda8 into OCA:16.0 Oct 8, 2025
5 of 7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 3febd70. 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.

5 participants