Skip to content

[16.0][FIX] sale_tier_validation: Basic compatibility with sale_loyalty#3381

Merged
OCA-git-bot merged 1 commit intoOCA:16.0from
Tecnativa:16.0-fix-sale_tier_validation-sale_loyalty
Mar 3, 2026
Merged

[16.0][FIX] sale_tier_validation: Basic compatibility with sale_loyalty#3381
OCA-git-bot merged 1 commit intoOCA:16.0from
Tecnativa:16.0-fix-sale_tier_validation-sale_loyalty

Conversation

@pedrobaeza
Copy link
Copy Markdown
Member

If you install sale_loyalty, this piece of code:

https://github.com/odoo/odoo/blob/2a7876538e9ea630563e39ee8402b27147d1e428/addons/sale_loyalty/models/sale_order.py#L740

is always executed when confirming a sales order, so it blocks it, no matter if no coupons are being handled.

This little code avoids this blocking without requiring a glue module, although further work would be needed if some coupons are applied.

@Tecnativa TT51484

If you install sale_loyalty, this piece of code:

https://github.com/odoo/odoo/blob/2a7876538e9ea630563e39ee8402b27147d1e428/addons/sale_loyalty/models/sale_order.py#L740

is always executed when confirming a sales order, so it blocks it, no
matter if no coupons are being handled.

This little code avoids this blocking without requiring a glue module,
although further work would be needed if some coupons are applied.

TT51484
@pedrobaeza pedrobaeza added this to the 16.0 milestone Oct 29, 2024
SirAionTech

This comment was marked as off-topic.

@SirAionTech

This comment was marked as off-topic.

@pedrobaeza
Copy link
Copy Markdown
Member Author

That's very weird... Look how it looks my "Request changes":

OCA/helpdesk#644 (review)

imagen

Maybe it's because you don't have enough permissions. The key is that yours is very easy to be missed. In fact, in this PR is the same like you didn't oppose to it.

@SirAionTech

This comment was marked as off-topic.

@pedrobaeza
Copy link
Copy Markdown
Member Author

Yeah, I see, then that's something I should pay attention from now on.

Copy link
Copy Markdown
Contributor

@carlos-lopez-tecnativa carlos-lopez-tecnativa left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown

@alexey-pelykh alexey-pelykh left a comment

Choose a reason for hiding this comment

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

Thanks Pedro, nice catch. The approach is solid -- detecting the empty applied_coupon_ids write from sale_loyalty and allowing it through the validation gate is the right trade-off vs. introducing a glue module for this.

LGTM.

@pedrobaeza
Copy link
Copy Markdown
Member Author

Merging, as the requested changes was a test from @SirAionTech

/ocabot merge patch

@OCA-git-bot
Copy link
Copy Markdown
Contributor

On my way to merge this fine PR!
Prepared branch 16.0-ocabot-merge-pr-3381-by-pedrobaeza-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit c92005b into OCA:16.0 Mar 3, 2026
0 of 2 checks passed
@OCA-git-bot
Copy link
Copy Markdown
Contributor

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