Skip to content
Snippets Groups Projects
Commit 7b7b67bb authored by Rémy Voet (ryv)'s avatar Rémy Voet (ryv)
Browse files

[FIX] stock: fix replenishement with archived RR


If some RR is archived and where the a forecasted demand on the
warehouse location, it Replenishement will crash will due to the
SQL constraint. It happens because the archived RR aren't take in
account in `_get_orderpoint_action` and the method will try to
create a orderpoint with same product + location which
lead to trigger the SQL constraint `product_location_check`.

Also avoid filtered in for loop to improve performance and use the
read_group instead.

task-2439019

closes odoo/odoo#67936

X-original-commit: 6737feef
Signed-off-by: default avatarArnold Moyaux <amoyaux@users.noreply.github.com>
Signed-off-by: default avatarRémy Voet <ryv-odoo@users.noreply.github.com>
parent c294f523
No related branches found
No related tags found
No related merge requests found
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