[18.0][OU-FIX] stock: fill default locations of archived picking types too#24
Open
eantones wants to merge 1 commit into
Open
[18.0][OU-FIX] stock: fill default locations of archived picking types too#24eantones wants to merge 1 commit into
eantones wants to merge 1 commit into
Conversation
…s too fill_stock_picking_type_default_locations() searches the picking types with a missing default location and recomputes them, but the search honors active_test, so archived picking types are silently skipped and the SET NOT NULL on default_location_src_id/default_location_dest_id (both required since 18.0) keeps failing on any database that has archived picking types with empty defaults. Search with active_test=False so the fill covers them as well.
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.
Problem
stock.picking.type.default_location_src_id/default_location_dest_idare required since 18.0 (stored computes). The stock18.0.1.1end-migration already fills the missing ones:but
search()honorsactive_test, so archived picking types are silently skipped. On any database carrying archived picking types with empty defaults, the fill only cures the active ones and the schema constraint keeps failing on every update:Observed on a real 14.0→18.0 chain: 74 active picking types with empty defaults were filled fine, while 49 archived ones (internal + mrp_operation, all with a warehouse) stayed NULL and blocked the
SET NOT NULL.Fix
Run both searches
with_context(active_test=False)so archived picking types get the same compute-based fill.