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] stock_picking_return_restricted_qty: Migration to 16.0 #1642

Merged

Conversation

ced-adhoc
Copy link
Contributor

@ced-adhoc ced-adhoc commented Jul 2, 2024

In this migration from v15 to v16, the following changes have been introduced:

  • Operation Type Configuration:
    A new restrict_return_qty Boolean field has been added to stock.picking.type, allowing users to enable or disable the restriction on returning more products than delivered for each operation type.

  • Updated Logic for Return Picking:
    The logic in stock_picking_return.py now checks the restrict_return_qty field from the related picking type. The restriction will trigger the UserError only if this setting is enabled.

  • Backward Compatibility:
    If the setting is not enabled, the standard behavior is maintained. This behavior is widely used in purchases, where items are returned to the vendor together in one operation, regardless of the original delivery.

Steps to use:

  1. Enable the "Restrict Return Quantity" option in Inventory > Configuration > Operation Types.
  2. Create a picking, validate it, and test the return process with the restriction enabled.

@ced-adhoc ced-adhoc force-pushed the 16.0-mig-stock_picking_return_restricted_qty branch 3 times, most recently from 515ca15 to abd54dc Compare July 3, 2024 14:46
@ced-adhoc ced-adhoc force-pushed the 16.0-mig-stock_picking_return_restricted_qty branch from abd54dc to d20fda7 Compare July 16, 2024 18:42
@ced-adhoc ced-adhoc force-pushed the 16.0-mig-stock_picking_return_restricted_qty branch from d20fda7 to 8025ea3 Compare July 25, 2024 19:49
@ced-adhoc ced-adhoc mentioned this pull request Aug 13, 2024
67 tasks
@ced-adhoc ced-adhoc force-pushed the 16.0-mig-stock_picking_return_restricted_qty branch 2 times, most recently from 97d2de6 to 74184ca Compare August 21, 2024 16:53
@ced-adhoc
Copy link
Contributor Author

Hi @rousseldenis, could you please check this PR? thanks in advance!

@mav-adhoc
Copy link

Techincal review OK!

Copy link

@florenciafrigieri2 florenciafrigieri2 left a comment

Choose a reason for hiding this comment

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

Functional test ok. It's working even if you do 2 or more returns over the same picking.

@florenciafrigieri2
Copy link

@simahawk Hi Simone! I saw you in the mainteiners list. Can you please take a look at this PR? Thanks!

@ced-adhoc
Copy link
Contributor Author

Hi @jbaudoux ! could you please check this PR? Thanks in advance!

@ced-adhoc
Copy link
Contributor Author

Hi @pedrobaeza, could you please check this PR? Thanks in advance!

@pedrobaeza
Copy link
Member

/ocabot migration stock_picking_return_restricted_qty

@sergio-teruel please confirm this migration is correct.

@OCA-git-bot OCA-git-bot added this to the 16.0 milestone Sep 9, 2024
@rousseldenis
Copy link
Sponsor Contributor

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 16.0-ocabot-merge-pr-1642-by-rousseldenis-bump-nobump, awaiting test results.

OCA-git-bot added a commit that referenced this pull request Sep 11, 2024
Signed-off-by rousseldenis
@OCA-git-bot
Copy link
Contributor

@rousseldenis your merge command was aborted due to failed check(s), which you can inspect on this commit of 16.0-ocabot-merge-pr-1642-by-rousseldenis-bump-nobump.

After fixing the problem, you can re-issue a merge command. Please refrain from merging manually as it will most probably make the target branch red.

@rousseldenis
Copy link
Sponsor Contributor

@ced-adhoc @sergio-teruel In fact, as this module changes the standard behavior, the restriction should be enabled through a parameter.

@ced-adhoc
Copy link
Contributor Author

@rousseldenis
Hi Denis,
Thanks for the feedback on the migration. I saw the suggestion about adding a parameter to enable the restriction, but I’m a bit unclear on what you meant. Could you explain a bit more about it?
Thanks in advance!

@ced-adhoc ced-adhoc force-pushed the 16.0-mig-stock_picking_return_restricted_qty branch 7 times, most recently from 888dacb to bc8f950 Compare October 1, 2024 21:01
@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

Copy link
Contributor

@jbaudoux jbaudoux left a comment

Choose a reason for hiding this comment

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

Can you split the migration commit into a pure migration commit and another for the improvements?

@ced-adhoc ced-adhoc force-pushed the 16.0-mig-stock_picking_return_restricted_qty branch 2 times, most recently from 621f2e4 to 17bd110 Compare October 4, 2024 20:41
@ced-adhoc
Copy link
Contributor Author

@jbaudoux all done! I guess

@jbaudoux
Copy link
Contributor

jbaudoux commented Oct 5, 2024

@jbaudoux all done! I guess

@ced-adhoc Nearly, the changes in wizard are in the wrong commit ;)

@ced-adhoc ced-adhoc force-pushed the 16.0-mig-stock_picking_return_restricted_qty branch from 17bd110 to 5525f7f Compare October 7, 2024 11:22
@ced-adhoc
Copy link
Contributor Author

@jbaudoux thanks! done

@jbaudoux
Copy link
Contributor

jbaudoux commented Oct 7, 2024

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 16.0-ocabot-merge-pr-1642-by-jbaudoux-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 61cf79b into OCA:16.0 Oct 7, 2024
12 checks passed
@OCA-git-bot
Copy link
Contributor

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