Skip to content
Snippets Groups Projects
Commit a4e2fa65 authored by Alvaro Fuentes's avatar Alvaro Fuentes
Browse files

[FIX] stock: fix KeyError for archived warehouses

The below line raises a KeyError when `warehouse` refers to an archived
warehouse.
https://github.com/odoo/odoo/blob/01cc43b0578ecc9d1fed37a12b2468ffc9d4aedd/addons/stock/models/stock_orderpoint.py#L396

The reason is that the SQL view created on
https://github.com/odoo/odoo/blob/01cc43b0578ecc9d1fed37a12b2468ffc9d4aedd/addons/stock/report/report_stock_quantity.py#L28-L37


doesn't take into account whether the warehouses are archived or not.

The solution proposed here is to fetch all warehouses to ensure the
lookup doesn't fail. Alternatively the view could be updated but that
will be a bigger change.

This issue was detected during the upgrade 226754

closes odoo/odoo#97222

X-original-commit: aaa7fb8f
Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
Signed-off-by: default avatarAlvaro Fuentes Suarez (afu) <afu@odoo.com>
parent 859dc0d9
Branches
Tags
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment