Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMP] website_sale_loyalty, sale_loyalty, pos_loyalty: one global discount (% or $) per order #144389

Closed

Conversation

mathysPaul
Copy link
Contributor

@mathysPaul mathysPaul commented Nov 30, 2023

Implements a restriction for ecommerce and PoS transactions
to allow only one global discount (either % or $) per order.
Ensures that for auto-applied discounts, the most advantageous
discount is selected for the customer. Backend sales configuration
remains flexible, allowing manual addition of discounts as before.
Defines global discounts as having a type of 'discount', with
modes 'per_order' or 'percent', and applicability to 'order'.

Related: odoo/enterprise#60144

task-2596416

@mathysPaul mathysPaul self-assigned this Nov 30, 2023
@robodoo
Copy link
Contributor

robodoo commented Nov 30, 2023

@mathysPaul mathysPaul marked this pull request as draft November 30, 2023 13:53
@mathysPaul mathysPaul changed the base branch from 17.0 to master November 30, 2023 13:54
@C3POdoo C3POdoo added the RD research & development, internal work label Nov 30, 2023
@mathysPaul mathysPaul marked this pull request as ready for review December 1, 2023 08:20
@mathysPaul mathysPaul marked this pull request as draft December 1, 2023 08:23
@mathysPaul mathysPaul force-pushed the master-loyalty-combinable-programs-matp branch 2 times, most recently from d62ff01 to 25ae762 Compare December 6, 2023 15:36
@mathysPaul mathysPaul force-pushed the master-loyalty-combinable-programs-matp branch 2 times, most recently from 397dae9 to 73283c9 Compare December 26, 2023 15:40
@mathysPaul mathysPaul changed the title [IMP] sale_loyalty: add combinable property to loyalty programs [IMP] ecommerce, pos: Limit to one global discount per order Jan 12, 2024
@mathysPaul mathysPaul force-pushed the master-loyalty-combinable-programs-matp branch from 4757b9b to 5f31f9b Compare January 17, 2024 14:12
@mathysPaul mathysPaul force-pushed the master-loyalty-combinable-programs-matp branch 2 times, most recently from 206ad58 to c01d984 Compare February 7, 2024 16:08
@mathysPaul mathysPaul force-pushed the master-loyalty-combinable-programs-matp branch 3 times, most recently from 7fb7800 to 2a0e7ee Compare March 7, 2024 11:12
@mathysPaul mathysPaul changed the title [IMP] ecommerce, pos: Limit to one global discount per order [IMP] website_sale, sale_loyalty: One global discount (% or $) per order Mar 7, 2024
@mathysPaul mathysPaul changed the title [IMP] website_sale, sale_loyalty: One global discount (% or $) per order [IMP] website_sale, sale_loyalty: one global discount (% or $) per order Mar 7, 2024
Copy link
Contributor

@chevalierv chevalierv left a comment

Choose a reason for hiding this comment

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

Hello @mathysPaul

Thanks for your work on this!

Please find my review under 🦆

One last thing: Squash your commits and take some times to write a good commit message 😃

Have a nice day!

addons/sale_loyalty/models/sale_order.py Show resolved Hide resolved
addons/sale_loyalty/models/sale_order.py Outdated Show resolved Hide resolved
addons/sale_loyalty/models/sale_order.py Outdated Show resolved Hide resolved
addons/sale_loyalty/models/sale_order.py Outdated Show resolved Hide resolved
addons/sale_loyalty/models/sale_order.py Outdated Show resolved Hide resolved
addons/sale_loyalty/models/sale_order.py Outdated Show resolved Hide resolved
addons/sale_loyalty/models/sale_order.py Outdated Show resolved Hide resolved
@mathysPaul mathysPaul force-pushed the master-loyalty-combinable-programs-matp branch from d4f7b5f to 51ef24b Compare March 20, 2024 12:53
@mathysPaul mathysPaul force-pushed the master-loyalty-combinable-programs-matp branch from d230d6f to 09da2e4 Compare March 21, 2024 13:54
@mathysPaul mathysPaul changed the title [IMP] website_sale, sale_loyalty: one global discount (% or $) per order [IMP] website_sale_loyalty, sale_loyalty, pos_loyalty: one global discount (% or $) per order Mar 21, 2024
@mathysPaul mathysPaul force-pushed the master-loyalty-combinable-programs-matp branch 3 times, most recently from 5664df5 to cc36402 Compare March 27, 2024 13:39
@mathysPaul mathysPaul force-pushed the master-loyalty-combinable-programs-matp branch 4 times, most recently from 12fdac5 to 77c54f0 Compare April 12, 2024 14:32
@mathysPaul mathysPaul marked this pull request as ready for review April 15, 2024 09:23
@C3POdoo C3POdoo requested review from a team and caburj and removed request for a team April 15, 2024 09:24
addons/sale_loyalty/models/sale_order.py Outdated Show resolved Hide resolved
addons/loyalty/models/loyalty_reward.py Outdated Show resolved Hide resolved
addons/sale_loyalty/models/sale_order.py Outdated Show resolved Hide resolved
addons/sale_loyalty/models/sale_order.py Outdated Show resolved Hide resolved
addons/sale_loyalty/models/sale_order.py Outdated Show resolved Hide resolved
addons/sale_loyalty/models/sale_order.py Outdated Show resolved Hide resolved
addons/loyalty/models/loyalty_reward.py Outdated Show resolved Hide resolved
addons/sale_loyalty/models/sale_order.py Outdated Show resolved Hide resolved
addons/sale_loyalty/models/sale_order.py Show resolved Hide resolved
addons/sale_loyalty/models/sale_order.py Show resolved Hide resolved
addons/sale_loyalty/models/sale_order.py Outdated Show resolved Hide resolved
addons/sale_loyalty/models/sale_order.py Outdated Show resolved Hide resolved
addons/sale_loyalty/models/sale_order.py Outdated Show resolved Hide resolved
addons/sale_loyalty/models/sale_order.py Outdated Show resolved Hide resolved
addons/loyalty/models/loyalty_reward.py Outdated Show resolved Hide resolved
@mathysPaul mathysPaul force-pushed the master-loyalty-combinable-programs-matp branch 2 times, most recently from 38847fb to 9f19529 Compare April 26, 2024 08:25
@mathysPaul mathysPaul requested a review from Feyensv April 29, 2024 06:36
@Feyensv Feyensv force-pushed the master-loyalty-combinable-programs-matp branch 2 times, most recently from 2dd1001 to 489c928 Compare April 30, 2024 08:47
Feyensv and others added 2 commits April 30, 2024 10:48
Some guidelines/docstring improvements.
Correct consideration of the currency decimal places
when checking whether an amount is zero.
…rder

Extends the existing restriction on global discounts to discounts of
a specific amount on the order (globally, not on specific products/lines).

Ensures that for auto-applied discounts, the most advantageous discount
is selected for the customer. Backend sales configuration remains flexible.

task-2596416
@Feyensv Feyensv force-pushed the master-loyalty-combinable-programs-matp branch from 489c928 to 7e5f70f Compare April 30, 2024 08:49
@Feyensv
Copy link
Contributor

Feyensv commented Apr 30, 2024

@robodoo r+ rebase-ff

@robodoo
Copy link
Contributor

robodoo commented Apr 30, 2024

Merge method set to rebase and fast-forward.

@Feyensv Feyensv removed their request for review April 30, 2024 09:51
robodoo pushed a commit that referenced this pull request Apr 30, 2024
Some guidelines/docstring improvements.
Correct consideration of the currency decimal places
when checking whether an amount is zero.

Part-of: #144389
robodoo pushed a commit that referenced this pull request Apr 30, 2024
…rder

Extends the existing restriction on global discounts to discounts of
a specific amount on the order (globally, not on specific products/lines).

Ensures that for auto-applied discounts, the most advantageous discount
is selected for the customer. Backend sales configuration remains flexible.

task-2596416

closes #144389

Related: odoo/enterprise#60144
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
@robodoo robodoo closed this Apr 30, 2024
@robodoo robodoo added the 17.3 label Apr 30, 2024
@fw-bot fw-bot deleted the master-loyalty-combinable-programs-matp branch May 14, 2024 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
17.3 RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants