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

[18.0][MIG] stock_picking_tier_validation: Migration to version 18.0 #1875

Open
wants to merge 10 commits into
base: 18.0
Choose a base branch
from

Conversation

Ricardo-MC
Copy link

No description provided.

@Ricardo-MC Ricardo-MC force-pushed the 18.0-mig-stock_picking_tier_validation branch from 35ff4c4 to 43c317b Compare February 13, 2025 23:39
@Ricardo-MC
Copy link
Author

/ocabot migration stock_picking_tier_validation

@OCA-git-bot
Copy link
Contributor

Sorry @Ricardo-MC you are not allowed to mark the addon tobe migrated.

To do so you must either have push permissions on the repository, or be a declared maintainer of all modified addons.

If you wish to adopt an addon and become it's maintainer, open a pull request to add your GitHub login to the maintainers key of its manifest.

@Ricardo-MC Ricardo-MC mentioned this pull request Feb 13, 2025
41 tasks
@rousseldenis
Copy link
Contributor

/ocabot migration stock_picking_tier_validation

Copy link
Contributor

@celm1990 celm1990 left a comment

Choose a reason for hiding this comment

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

Tested and working. Just a technical comment to make the test as realistic as possible. What do you think?

CC @pedrobaeza @bosd @StefanRijnhart

Comment on lines +44 to +58
cls.tier_def_obj.create(
{
"model_id": cls.tester_model.id,
"review_type": "individual",
"reviewer_id": cls.test_user_1.id,
"definition_domain": "[('test_field', '>', 1.0)]",
}
)

cls.test_record = cls.test_model.create({"test_field": 2.5})

@classmethod
def tearDownClass(cls):
teardown_test_model(cls.env, [TierValidationTester])
super().tearDownClass()
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can add a real test for the stock.picking model instead of creating a fake model, similar to:
https://github.com/OCA/sale-workflow/blob/17.0/sale_tier_validation/tests/test_tier_validation.py

Copy link
Member

Choose a reason for hiding this comment

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

Agreed! The tests here are clearly copied from base_tier_validation, which makes no sense, and it would be good to have them replaced by a proper validation flow as is the case in for instance https://github.com/OCA/stock-logistics-workflow/blob/17.0/stock_scrap_tier_validation/tests/test_tier_validation.py#L50-L66.

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.

7 participants