Skip to content

Fix warehouse propagation in MTO procurements - #962

Open
fw-bot-adhoc wants to merge 1 commit into
ingadhoc:19.0from
adhoc-dev:19.0-18.0-h-118573-jc-5990-fw
Open

Fix warehouse propagation in MTO procurements#962
fw-bot-adhoc wants to merge 1 commit into
ingadhoc:19.0from
adhoc-dev:19.0-18.0-h-118573-jc-5990-fw

Conversation

@fw-bot-adhoc

Copy link
Copy Markdown
Contributor

Summary

  • override stock.move._prepare_procurement_values() in stock_ux to propagate the warehouse that owns the physical source location
  • avoid reusing draft RFQs from a different warehouse in multi-warehouse MTO chains
  • prevent purchase orders from mixing destinations from different warehouses and later failing the operation type consistency check

Why

In some multi-warehouse MTO flows the move still carries the commercial warehouse in warehouse_id even 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.

Forward-Port-Of: #928

@roboadhoc

Copy link
Copy Markdown
Collaborator

Pull request status dashboard

@fw-bot-adhoc

Copy link
Copy Markdown
Contributor Author

@jcadhoc @les-adhoc cherrypicking of pull request #928 failed.

stdout:

Auto-merging stock_ux/models/stock_move.py
CONFLICT (content): Merge conflict in stock_ux/models/stock_move.py

Either perform the forward-port manually (and push to this branch, proceeding as usual) or close this PR (maybe?).

:shipit: you can use git-fw to re-do the forward-port for you locally.

⚠️ after resolving this conflict, you will need to merge it via @roboadhoc.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@fw-bot-adhoc

Copy link
Copy Markdown
Contributor Author

@jcadhoc @les-adhoc this forward port of #928 is awaiting action (not merged or closed).

@jcadhoc
jcadhoc force-pushed the 19.0-18.0-h-118573-jc-5990-fw branch from 9483d58 to 1ac7c2c Compare July 7, 2026 18:38
@les-adhoc

Copy link
Copy Markdown
Contributor

@roboadhoc r+ nobump

roboadhoc pushed a commit that referenced this pull request Jul 7, 2026
Override stock.move._prepare_procurement_values() to propagate the
warehouse that owns the physical source location, avoiding stale
commercial warehouses being carried into the next procurement in
multi-warehouse MTO chains (reuse of draft RFQs from the wrong
warehouse / mixed destinations failing the operation type check).

Forward-Port-Of: #928

Resolved forward-port conflicts for 19.0:
- dropped the _action_assign override (removed in 19.0, folded into
  _trigger_assign), keeping only _prepare_procurement_values
- tests/__init__.py imports only test_mto_warehouse_propagation
  (test_stock_orderpoint_multiple_over_max is not present in 19.0)
- removed name= kwarg in the test (stock.move.name no longer exists
  in 19.0)

closes #962

Signed-off-by: Luciano Esperlazza <les@adhoc.inc>
Override stock.move._prepare_procurement_values() to propagate the
warehouse that owns the physical source location, avoiding stale
commercial warehouses being carried into the next procurement in
multi-warehouse MTO chains (reuse of draft RFQs from the wrong
warehouse / mixed destinations failing the operation type check).

Forward-Port-Of: ingadhoc#928

Resolved forward-port conflicts for 19.0:
- dropped the _action_assign override (removed in 19.0, folded into
  _trigger_assign), keeping only _prepare_procurement_values
- tests/__init__.py imports only test_mto_warehouse_propagation
  (test_stock_orderpoint_multiple_over_max is not present in 19.0)
- removed name= kwarg in the test (stock.move.name no longer exists
  in 19.0)
@jcadhoc
jcadhoc force-pushed the 19.0-18.0-h-118573-jc-5990-fw branch from 1ac7c2c to d923615 Compare July 7, 2026 19:59
@fw-bot-adhoc

Copy link
Copy Markdown
Contributor Author

@jcadhoc @les-adhoc this forward port of #928 is awaiting action (not merged or closed).

2 similar comments
@fw-bot-adhoc

Copy link
Copy Markdown
Contributor Author

@jcadhoc @les-adhoc this forward port of #928 is awaiting action (not merged or closed).

@fw-bot-adhoc

Copy link
Copy Markdown
Contributor Author

@jcadhoc @les-adhoc this forward port of #928 is awaiting action (not merged or closed).

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.

3 participants