[18.0][MIG] stock_location_flowable: Migration to 18.0#720
[18.0][MIG] stock_location_flowable: Migration to 18.0#720
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR migrates the stock_location_flowable module from an earlier version to 18.0. The module provides functionality for managing flowable storage locations that can hold liquid and solid bulk products with specific constraints around product mixing and manufacturing operations.
Key changes:
- Migration to Odoo 18.0 framework
- Updated copyright headers to 2025
- Updated Spanish translations
Reviewed Changes
Copilot reviewed 28 out of 29 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
__manifest__.py |
Updated version to 18.0.1.0.0 and dependencies |
models/*.py |
Core business logic for flowable locations, picking operations, and manufacturing integration |
views/*.xml |
XML view definitions for enhanced UI forms and lists |
tests/*.py |
Comprehensive test coverage for module functionality |
i18n/es.po |
Spanish translation updates |
readme/ and static/ |
Documentation and static assets |
| _("Capacity must be greater than capacity occupied %s") | ||
| % rec.flowable_capacity_occupied |
There was a problem hiding this comment.
Missing space between 'occupied' and '%s' placeholder in the error message. Should be 'capacity occupied %s' for better readability.
| if product not in location_dest.flowable_allowed_product_ids: | ||
| raise UserError( | ||
| _( | ||
| "Product %(product)s not allowed in" |
There was a problem hiding this comment.
Missing space between 'in' and 'flowable' in the error message string. Should be 'not allowed in flowable location' for proper grammar.
| "Product %(product)s not allowed in" | |
| "Product %(product)s not allowed in " |
| #. module: stock_location_flowable | ||
| #: code:addons/stock_location_flowable/models/stock_picking_type.py:0 | ||
| #, python-format | ||
| msgid "Only one picking type can be flowable in a warehouse %s.." |
There was a problem hiding this comment.
The English msgid has a double period '..' at the end which should be a single period '.'.
| msgid "Only one picking type can be flowable in a warehouse %s.." | |
| msgid "Only one picking type can be flowable in a warehouse %s." |
2367397 to
2c84907
Compare
2c84907 to
78a418c
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 18.0 #720 +/- ##
=======================================
Coverage ? 98.19%
=======================================
Files ? 20
Lines ? 1388
Branches ? 117
=======================================
Hits ? 1363
Misses ? 8
Partials ? 17 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…eamline return process
…move the multi treatment
…a dedicated producing_lot variable
…rch per product Move mrp_operation_type search and validation out of the per-product loop and into a single check per picking, running only when there are flowable destination lines. Skip non-flowable pickings early with continue. Update error messages to reference warehouse instead of location: - "Not found flowable manufacturing picking type in warehouse %s" - "More than one flowable manufacturing picking type in warehouse %s" - "Not found sequence in flowable manufacturing picking type %s" Adapt tests to match the new validation order and messages: - Enable flowable_operation in tests that expect product-level errors (one product, not allowed, different UoM) since the mrp_operation_type check now runs before those validations - Update expected error message strings in test_not_found_manufacturing_picking_type_incoming_picking and test_mrp_operation_type_without_sequence_raises_error
…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.
…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.
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)
Rename all test data to use liquid gas domain examples instead of generic or Spanish names, making tests self-documenting and consistent with the real-world use case. Products: Liquid O2, Liquid N2, Liquid He, etc. Locations: O2 Tank 1..6, Warehouse Shelf UoM categories: Liquid O2 (kg/L density conversion) Non-gas products: Steel Bolts (for "not allowed" scenarios)
When a reception has multiple move lines targeting the same flowable location with the same product and lot, they must be aggregated into a single manufacturing order.
…g flowable lines
The old message ("You can only receive one product at location...") was
confusing: it mentioned "one product" even when the conflict was between
lots, not products, and gave vague instructions.
The new message lists the conflicting product/lot combinations and tells
the user to create a backorder. Also adds a comment explaining why we
keep the pre-check instead of relying on the blocking mechanism (EAFP):
the natural constraint error would reference a phantom MO from the same
rolled-back transaction.
After completing a flowable mixing order, verify that all non-producing lots at the location have exactly 0 stock using float_is_zero with UoM rounding. This should not be necessary under normal operation and might be removed in the future, but catches rounding residuals or manual inventory adjustments that could silently corrupt stock.
…kflows Cover additional flowable scenarios that follow natural user workflows: picking with mixed flowable/non-flowable lines, sequential receptions with MO completion between each, pre-check rejection of multiple lots to the same location, blocked location preventing a second reception, different lots to different locations in one receipt, zero-qty lines ignored, top-up with same lot at auto-lot location, return from mixed picking, rounding residual quant detection, and defensive post-production quant check for both create_lots modes.
78a418c to
38d191e
Compare
237ab6f to
d22e471
Compare
No description provided.