Skip to content

[18.0][FIX] barcode_scanner: notify errors as danger - #25

Merged
OCA-git-bot merged 1 commit into
OCA:18.0from
BinhexTeam:18.0-fix-barcode_scanner-notification-type
Nov 13, 2026
Merged

OCA-git-bot merged 1 commit into
OCA:18.0from
BinhexTeam:18.0-fix-barcode_scanner-notification-type

Conversation

@antoniodavid

@antoniodavid antoniodavid commented Nov 6, 2026 •

Copy link
Copy Markdown

Description

BarcodeScannerFeedbackService forwarded the feedback level directly as the notification type. Odoo expects danger for error notifications, so error produced an invalid notification type and error feedback was not rendered as a danger notification.

This maps feedback levels to valid Odoo notification types and adds a regression test covering success, warning, info and error.

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @szalatyzuzanna,
some modules you are maintaining are being modified, check this out!

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

The code looks good to me; just a suggestion—feel free to proceed as you see fit.

@@ -0,0 +1,41 @@
/* @odoo-module */

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I don’t think it would be necessary; what do you think?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

You're right, files under static/tests are already treated as Odoo modules. Removed in 50926f2. Thanks!

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

Thanks for the fix! LGTM.
Could you squash both commits into a single [FIX] one and force-push?

@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@antoniodavid
antoniodavid force-pushed the 18.0-fix-barcode_scanner-notification-type branch 2 times, most recently from d668a30 to c237026 Compare November 12, 2026 14:10
@szalatyzuzanna

Copy link
Copy Markdown

/ocabot merge patch

@OCA-git-bot

Copy link
Copy Markdown
Contributor

On my way to merge this fine PR!
Prepared branch 18.0-ocabot-merge-pr-25-by-szalatyzuzanna-bump-patch, awaiting test results.

BarcodeScannerFeedbackService forwarded the feedback level directly as the notification type. Odoo expects "danger" for error notifications, so "error" was not rendered as a danger notification.

Map feedback levels to valid Odoo notification types and add a regression test covering all levels.
@antoniodavid
antoniodavid force-pushed the 18.0-fix-barcode_scanner-notification-type branch from c237026 to bcc67c1 Compare November 13, 2026 01:09
@szalatyzuzanna

Copy link
Copy Markdown

/ocabot merge patch

@OCA-git-bot

Copy link
Copy Markdown
Contributor

On my way to merge this fine PR!
Prepared branch 18.0-ocabot-merge-pr-25-by-szalatyzuzanna-bump-patch, awaiting test results.

@OCA-git-bot

Copy link
Copy Markdown
Contributor

@szalatyzuzanna your merge command was aborted due to failed check(s), which you can inspect on this commit of 18.0-ocabot-merge-pr-25-by-szalatyzuzanna-bump-patch.

After fixing the problem, you can re-issue a merge command. Please refrain from merging manually as it will most probably make the target branch red.

@szalatyzuzanna

Copy link
Copy Markdown

/ocabot merge patch

@OCA-git-bot

Copy link
Copy Markdown
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 18.0-ocabot-merge-pr-25-by-szalatyzuzanna-bump-patch, awaiting test results.

@OCA-git-bot

Copy link
Copy Markdown
Contributor

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

@atgalvez08
atgalvez08 deleted the 18.0-fix-barcode_scanner-notification-type branch November 13, 2026 14:37
@OCA-git-bot
OCA-git-bot merged commit db880e3 into OCA:18.0 Nov 13, 2026
8 checks passed
@OCA-git-bot

Copy link
Copy Markdown
Contributor

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

4 participants