Skip to content
Snippets Groups Projects
Commit a4f857d9 authored by Arnold Moyaux's avatar Arnold Moyaux
Browse files

[FIX] mrp: orderpoint for manufacture not trigger twice


Usecase to reproduce:
With BoM structure
- Product A (RR 1-20)
	|
	Product B (MTO)
		|
		Product C (RR 5-50)
			|
			Product D (Buy)

Launch the RR. The MO are:
Current Behavior
- Product A 20
- Product B 20
- Product C 50
- Product C 70

Expected Behavior
- Product A 20
- Product B 20
- Product C 50

It happens because the MO are created as draft during the
`_run_manufacture` and are confirm at the end of
`_procure_orderpoint_confirm` in '_post_process_scheduler`.

However at the first MO for product A, it creates a MO for product B
and since it consumes product c, it checks if the orderpoint should be
trigger. MO for product C still "draft" and the orderpoint forecast is
now -20, so it will create a new procurement for product C with 70 units

To fix it we take the MO draft linked to the orderpoint for the
forecasted quantity.

closes odoo/odoo#88590

Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
parent 43165dc3
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment