Fix warehouse propagation in MTO procurements#928
Closed
jcadhoc wants to merge 4 commits into
Closed
Conversation
Collaborator
The MTO warehouse propagation guard checked for `raw_material_production_id` (defined by mrp) and then read `subcontractor_id`, which only exists once mrp_subcontracting is installed. On a database with mrp but not mrp_subcontracting, that read raised AttributeError during procurement, blocking the picking/order flow. Guard the subcontractor read with a field presence check. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
44ad9e5 to
1d4db9c
Compare
Satisfies the end-of-file-fixer pre-commit hook. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
@roboadhoc r+ nobump |
Collaborator
|
@jcadhoc @les-adhoc because this PR has multiple commits, I need to know how to merge it:
|
Contributor
|
@roboadhoc rebase-ff |
roboadhoc
pushed a commit
that referenced
this pull request
Jun 25, 2026
Part-of: #928 Signed-off-by: Luciano Esperlazza <les@adhoc.inc>
roboadhoc
pushed a commit
that referenced
this pull request
Jun 25, 2026
Part-of: #928 Signed-off-by: Luciano Esperlazza <les@adhoc.inc>
roboadhoc
pushed a commit
that referenced
this pull request
Jun 25, 2026
The MTO warehouse propagation guard checked for `raw_material_production_id` (defined by mrp) and then read `subcontractor_id`, which only exists once mrp_subcontracting is installed. On a database with mrp but not mrp_subcontracting, that read raised AttributeError during procurement, blocking the picking/order flow. Guard the subcontractor read with a field presence check. Part-of: #928 Signed-off-by: Luciano Esperlazza <les@adhoc.inc> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
roboadhoc
pushed a commit
that referenced
this pull request
Jun 25, 2026
Satisfies the end-of-file-fixer pre-commit hook. closes #928 Signed-off-by: Luciano Esperlazza <les@adhoc.inc> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Collaborator
|
Merge method set to rebase and fast-forward. |
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.

Summary
stock.move._prepare_procurement_values()instock_uxto propagate the warehouse that owns the physical source locationWhy
In some multi-warehouse MTO flows the move still carries the commercial warehouse in
warehouse_ideven though its real source location belongs to another warehouse. That stale value is propagated to the next procurement and can attach buy procurements to a draft RFQ from the wrong warehouse.