Skip to content

[16.0][REF] stock_storage_type: remove allow_new_product field from storage capacity lines #1006

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

Open
wants to merge 3 commits into
base: 16.0
Choose a base branch
from

Conversation

sebalix
Copy link
Contributor

@sebalix sebalix commented Apr 18, 2025

Module is now using only the standard allow_new_product field set on the storage category.

Address #976

TODO:

  • remove allow_new_product field from capacity lines + adapt code & tests
  • add a new "Storage Condition" data model to display on form view, allowing to set a different allow_new_product value based on a condition (domain)
  • write a migration script to move old allow_new_product values from capacity lines to these new conditions

@sebalix sebalix added this to the 16.0 milestone Apr 18, 2025
@OCA-git-bot
Copy link
Contributor

Hi @rousseldenis, @jbaudoux,
some modules you are maintaining are being modified, check this out!

…acity lines

Module is now using only the standard `allow_new_product` field set on
the storage category.
@sebalix sebalix force-pushed the 16-imp-stock_storage_type branch 2 times, most recently from 4a2b1b0 to 926cbdc Compare April 23, 2025 07:21
@jbaudoux jbaudoux self-requested a review April 23, 2025 07:39
@sebalix sebalix marked this pull request as ready for review April 23, 2025 12:20
@sebalix
Copy link
Contributor Author

sebalix commented Apr 23, 2025

Seems that these shopfloor tests are broken with these changes:

  • ./shopfloor/tests/test_location_content_transfer_putaway.py
    • test_ignore_no_putaway_available
    • test_normal_putaway
  • ./shopfloor/tests/test_single_pack_transfer_putaway.py
    • test_ignore_no_putaway_available

Checking

EDIT: should be fixed, I had to split the allow_new_product value in its own field, and the code snippet returning a boolean value telling if the condition is met or not, it was a bad idea to define the allow_new_product value directly in the code snippet, as the different computed+stored field on stock.location need to check all category conditions if one of them could make the location elligible (as it was the case before with capacities). Implementation updated accordingly.

sebalix added 2 commits April 23, 2025 17:12
Conditions based on different criteria can be written to fine tune the
"Allow New Product" policy.

A `stock.storage.condition.mixin` has been added so both the new data
model `stock.storage.category.condition` and
`stock.storage.location.sequence.cond` inherit from it.
@sebalix sebalix force-pushed the 16-imp-stock_storage_type branch from f109a51 to 01c5545 Compare April 23, 2025 15:12
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.

2 participants