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][FIX] stock_picking_delivery_link: Test compatibility with purchase #781

Conversation

victoralmau
Copy link
Member

@victoralmau victoralmau commented Mar 13, 2024

Related to #755 (https://github.com/OCA/delivery-carrier/actions/runs/8269746616/job/22625732737)

Avoid test errors if the purchase module is installed

Please @pedrobaeza and @carolinafernandez-tecnativa can you review it?

@Tecnativa TT46563

Avoid test errors if the purchase module is installed

TT46563
@victoralmau victoralmau force-pushed the 16.0-fix-stock_picking_delivery_link-tests-purchase_compatibility branch from fc04ecc to 3cce9bb Compare March 13, 2024 10:25
@rousseldenis
Copy link
Contributor

@victoralmau I don't like putting some code that depends on module that is not in dependencies...

@victoralmau
Copy link
Member Author

@victoralmau I don't like putting some code that depends on module that is not in dependencies...

Ok, I understand, any suggestions to avoid tests failing if purchase is installed?

@carolinafernandez-tecnativa
Copy link
Contributor

I have checked and it looks good to me, what do you think @pedrobaeza ?

@rousseldenis
Copy link
Contributor

@victoralmau I don't like putting some code that depends on module that is not in dependencies...

Ok, I understand, any suggestions to avoid tests failing if purchase is installed?

@victoralmau Don't check purchase module. Fill in simply the seller_ids field as this is implemented in product.

@victoralmau
Copy link
Member Author

@victoralmau I don't like putting some code that depends on module that is not in dependencies...

Ok, I understand, any suggestions to avoid tests failing if purchase is installed?

@victoralmau Don't check purchase module. Fill in simply the seller_ids field as this is implemented in product.

@victoralmau I don't like putting some code that depends on module that is not in dependencies...

Ok, I understand, any suggestions to avoid tests failing if purchase is installed?

@victoralmau Don't check purchase module. Fill in simply the seller_ids field as this is implemented in product.

Even if we do that we will still have to confirm the purchase and the tests will fail. Please try the following use case:

  • Install stock_picking_delivery_link + purchase.
  • Run the tests of stock_picking_delivery_link

@victoralmau
Copy link
Member Author

Any other proposal to solve the tests of this module? This blocks #755

@victoralmau
Copy link
Member Author

Any other better proposals to solve this problem? This blocks several migrations.

@carolinafernandez-tecnativa
Copy link
Contributor

Can we procedure to merge? So we can unblock several migrations. Thanks!

@carolinafernandez-tecnativa
Copy link
Contributor

Can we move forward to merge? @pedrobaeza @rousseldenis

@carolinafernandez-tecnativa
Copy link
Contributor

@pedrobaeza What do you think?

@@ -26,6 +26,16 @@ def setUpClass(cls):
"product_id": test_carrier_product.id,
}
)
# We need to know if purchase module is installed
cls.purchase_installed = False
Copy link
Member

Choose a reason for hiding this comment

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

Maybe it is cleaner to use

Suggested change
cls.purchase_installed = False
cls.purchase_installed = cls.env.ref("base.module_purchase").state == "installed"

@pedrobaeza
Copy link
Member

@rousseldenis I have been 2 hours trying to get another solution in #755, but I see no other solution than this one.

The problem is that the tests test_put_in_pack_from_pick_with_wizard* of stock_picking_delivery_link works by chance: they create the stock.move with procure_method = "make_to_order", launching a procurement that is resolved with a lucky fallback to the rule "WH: Vendors → Stock", which creates an extra move for resolving move_orig_ids, but that's not possible when purchase_stock gets installed (or at least I'm not able to force it).

Can you propose an alternative or to not block this?

@carolinafernandez-tecnativa
Copy link
Contributor

Hi, @rousseldenis have you checked what @pedrobaeza commented before?

@carolinafernandez-tecnativa
Copy link
Contributor

Hi, any news? we need to unlock several migrations

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.

Let's merge this as the less bad solution. Later, other options can be proposed:

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 16.0-ocabot-merge-pr-781-by-pedrobaeza-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit a748b1c into OCA:16.0 May 24, 2024
4 of 7 checks passed
@OCA-git-bot
Copy link
Contributor

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

@pedrobaeza pedrobaeza deleted the 16.0-fix-stock_picking_delivery_link-tests-purchase_compatibility branch May 24, 2024 10:54
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