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

[16.0][MIG] sale_coupon_multi_gift>sale_loyalty_multi_gift: Migration to version 16.0 #196

Merged
merged 10 commits into from
Jul 12, 2024

Conversation

pilarvargas-tecnativa
Copy link
Contributor

@pilarvargas-tecnativa pilarvargas-tecnativa commented Dec 11, 2023

Copy link
Member

@chienandalu chienandalu left a comment

Choose a reason for hiding this comment

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

When there's only one multi-gift promo the wizard doesn't pop up and ll the products are put into the order, even all the options.

When there are several, the wizards shows up, but I can't do anything with the options. What's the plan?
image

@pilarvargas-tecnativa
Copy link
Contributor Author

pilarvargas-tecnativa commented Jan 17, 2024

When there's only one multi-gift promo the wizard doesn't pop up and ll the products are put into the order, even all the options.

In v16, the promotions that have as a reward a product to choose between several products have this behaviour, if there are not several promotions the wizard does not open and they apply as a reward the default product.

Also, in v13 and v15, this is the behaviour, the wizard is opened by the module sale_coupon_order_suggestion (which is not yet migrated) with the gift icon in the order line that is part of a promotion.

A test in v15, with the modules installed:

  • sale_coupon_criteria_multi_product
  • sale_coupon_multi_gift
  • sale_coupon_selection_wizard
    The wizard does not open and the default product of the promotion is applied.

A promotion is configured in which buying a white table or a black table you get a lamp or a bin as a reward.
image

Without sale_coupon_order_suggestion there is no icon to open the wizard and it does not open by itself.

v15

When there are several, the wizards shows up, but I can't do anything with the options. What's the plan?

When there are alternative products as rewards, the list shows the configured products on the left side and on the right side you can select the product to apply.

Tests in v16:
A promotion is configured in which when the rules are met it will give away a bin or a lamp.
When there is only one promotion applicable, the default product (in this case the bin) will be given as a reward:

v16-1

When there are several promotions the wizard will open to select which promotion to apply and which product as a reward (same as in previous versions and same behaviour of odoo in v16):

v16-2

If there are several products as a reward, they will be shown in the wizard to choose whether to apply the default one or select another one. Each line of the list is a reward product, as I said before, on the left side the options are shown and on the right side the selected one.

Description of the rewards of the promotion (2 gifts):
image

List of products configured in the promotion (same as in previous versions - 2 gifts, 1 unit of one and 2 units of another):
image

List shown in the wizard (2 products with their options):
image

Once the promotion is applied in the sales order we have two rewards, 1 unit of bin and 2 units of table.
image

@chienandalu
Copy link
Member

  • You're adding every option to the cart: that's not correct. You should add only the default one if you do it automatically
  • The idea is to use the core wizard to hook our option choosing behavior so this module is now self containing.

@pilarvargas-tecnativa pilarvargas-tecnativa force-pushed the 16.0-mig-sale_coupon_multi_gift branch 4 times, most recently from 1f402d3 to 0c9c043 Compare January 23, 2024 07:13
@pilarvargas-tecnativa
Copy link
Contributor Author

@chienandalu I have relaunched

When the dependency is merged I will remove the commits that do not correspond to the migration.

@chienandalu
Copy link
Member

I'm getting errors when trying to apply it:

image

This is how it's configured
image

@pilarvargas-tecnativa pilarvargas-tecnativa force-pushed the 16.0-mig-sale_coupon_multi_gift branch from 0c9c043 to 0e8d0ed Compare January 24, 2024 08:30
@pilarvargas-tecnativa
Copy link
Contributor Author

I'm getting errors when trying to apply it:

Corrected! thanks

@pedrobaeza
Copy link
Member

/ocabot migration sale_coupon_multi_gift

@OCA-git-bot OCA-git-bot added this to the 16.0 milestone Jul 11, 2024
@OCA-git-bot OCA-git-bot mentioned this pull request Jul 11, 2024
15 tasks
@pedrobaeza pedrobaeza force-pushed the 16.0-mig-sale_coupon_multi_gift branch from 7c8591a to 08dd6b7 Compare July 11, 2024 10:25
chienandalu and others added 7 commits July 11, 2024 12:51
Now we use the product field in the multi gift line as a mask for a
many2many field that can be used by a third module as a way to offer
optional gifts to the user.

TT30850
When we've got mixed optional rewards
we need to tell for sure which reward
line belongs a sale line to so we can
apply the right product when the reward
is updated.

TT34266
@pilarvargas-tecnativa pilarvargas-tecnativa force-pushed the 16.0-mig-sale_coupon_multi_gift branch from 08dd6b7 to 3cf0517 Compare July 11, 2024 10:52
Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

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

@OCA-git-bot OCA-git-bot merged commit b5117b5 into OCA:16.0 Jul 12, 2024
5 of 7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 597322f. Thanks a lot for contributing to OCA. ❤️

@pedrobaeza pedrobaeza deleted the 16.0-mig-sale_coupon_multi_gift branch July 12, 2024 18:05
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.

6 participants