[FIX] stock_inventory_preparation_filter: exclude virtual locations from domain filter - #2604
SaraMohamedlorim wants to merge 1 commit into
Conversation
|
@SaraMohamedlorim Thanks for this. You should follow this migration guide: https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-17.0 You need to keep commits history |
There was a problem hiding this comment.
Hello @SaraMohamedlorim thank you for fixing this. I can not find the update on Runboat, could you follow the guide, please?
I would love to test and approve it. please let me know once you update and ready to test on Runboat. ;)
…rom quant search _get_quants() searched quants by product_id only when using the "Filtered Products" (domain) selection, without filtering by location_id, so quants from virtual locations (Customers, Inventory Adjustments, etc.) were included in the inventory count. (cherry picked from commit 562e287)
4b11a55 to
7125993
Compare
|
@rousseldenis @nurinayati Thanks for the feedback. You're right — the same bug also exists on 16.0 and 18.0, so I've followed the OCA convention of fixing the oldest maintained branch first and forward-porting from there: Opened a fix on 16.0 first: #[2604] Let me know if you'd like me to do the same for 18.0. |
|
thank you @SaraMohamedlorim. Can we include the sublocations? It's missing for inventory adjustments |
|
Hi @rousseldenis, are there any other technical points to fix? Could you review again, please? thanks |


Problem
When using Filtered Products (domain) selection in Inventory Adjustment,
the results include quants from virtual locations (e.g. Customers, Inventory Adjustments),
which should not appear in a physical inventory count.
Fixes #2498
Root Cause
_get_quants()was searching quants byproduct_idonly, without filteringby
location_id, causing virtual location quants to be included.Solution
Added
location_idfilter to the quant search in_get_quants()whenproduct_selection == "domain", consistent with how other selectionmodes handle location filtering.
Steps to Reproduce
After Fix