[14.0][FIX] stock_location_flowable: flowable location blocking#849
Open
[14.0][FIX] stock_location_flowable: flowable location blocking#849
Conversation
…heck The blocked-location constraint in stock_move_line.py used the move's state to decide which production field to check (production_id vs raw_material_production_id). Moves not linked to any MO (e.g. a second PO reception or an internal transfer) had production=False, and the guard `if production and ...` was skipped entirely — allowing writes to a blocked location. Change the production lookup to `raw_material_production_id or production_id` (always finds the linked MO if any) and invert the guard to check `if location.flowable_production_id and ... \!= production` so the constraint fires on any move to a blocked location, regardless of origin.
…tion conflicts Before this fix, flowable locations were blocked as soon as raw materials entered confirmed or partially_available state, causing false rejections of incoming receipts. Now blocking only occurs when all raw materials reach assigned state. Additionally, _trigger_assign is bypassed during picking completion to prevent automatic reservation of unrelated moves at the flowable location, and a post-reservation check (action_assign override) ensures the mixing order can be fully reserved before proceeding.
Restructure the write method for clarity: early return for non-flowable operations, separate state checks into disjoint branches, and skip iterations when state is not changing.
Add tests covering the full flowable location blocking lifecycle: reception blocking, second reception rejection, full cycle (block/unblock), per-location isolation, auto-lot assignment, and non-flowable location passthrough.
…ntation Add comprehensive technical documentation explaining the flowable location blocking mechanism, including SVG diagrams covering the full lifecycle: reception, blocking, second reception rejection, MO completion, cancellation, internal transfers, and reservation conflicts.
Fix manifest author to match pylintrc-mandatory requirements and update CONTRIBUTORS.rst to proper RST format with Eric Antones. Regenerate README.rst and index.html via oca-gen-addon-readme.
Add complete Catalan (ca.po) and Spanish (es.po) translation files covering all translatable strings in the module.
4 tasks
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 14.0 #849 +/- ##
==========================================
+ Coverage 49.30% 50.07% +0.76%
==========================================
Files 971 971
Lines 15971 16217 +246
Branches 3450 3477 +27
==========================================
+ Hits 7874 8120 +246
+ Misses 7889 7886 -3
- Partials 208 211 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…lowable MO Add a safety check that verifies the number of positive quants at a flowable location before creating the manufacturing order. On initial reception (empty tank) there must be exactly 1 quant. On mixing (different lot arrives) there must be exactly 2 quants, one for each lot. This catches data inconsistencies early instead of letting the MO be created with wrong inputs.
…to TestCommon Move shared test helpers (_create_lot, _receive_stock, _create_incoming_picking, _find_flowable_production, _get_location_quants, _get_positive_quantity, _seed_flowable_location, _create_inventory_adjustment) from individual test classes into TestCommon. Rebase TestFlowableBlockingWithReservations on TestCommon instead of SavepointCase. Replace all inline duplicated patterns across 8 test files with helper calls.
d5612af to
08ef48d
Compare
Add 4 natural user-workflow tests covering previously untested code paths in the flowable blocking lifecycle: - MO-based reservation conflict detection (mrp_production lines 93-99) - Capacity reduction below occupied amount (stock_location line 123) - Flowable conversion with incompatible UoM stock (stock_location lines 195-198) - Mixing reception with rounding residual quant (stock_picking line 242)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #847
Summary
raw_material_production_id or production_idinstead of state-based logic)assignedstate,_trigger_assignis bypassed during picking completion, and a post-reservation check ensures the mixing order can be fully reservedTest plan