Guewen Baconnier e707c810e3 Fix computation of stock available unreserved
The computation of the unreserved available amount using the
StockQuant._get_available_quantity was wrong as soon as more than one
quant was found for the same product. It can easily happen when you have
sublocations and a quant in each location.

The reason is that the algorithm was:

1. searching for all the quants for a given product
2. calling StockQuant._get_available_quantity for each quant
3. _get_available_quantity is an @api.model method, which itself will
search for all quants for the product and the given location and
children

Which means that if you have these locations:

Stock
Stock > Bin A
Stock > Bin B

And these quants:

1. Product: Product A
   Location: Bin A
   Quantity: 60
   Reserved: 0

2. Product: Product A
   Location: Bin B
   Quantity: 10
   Reserved: 0

Instead of 70, the result was 140. (One loop for each quant, each loop
recomputing the total quantity in _get_available_quantity, all summed
togethed, for each new quant, an additional sum would be added).

Ultimately, the _get_available_quantity method does the sum of (quantity
- quantity reserved). This commit uses the same logic than the 10.0
branch, it finds the quants contextually using
ProductProduct._get_domain_locations and get the available quantity as
the sum of (quantity - quantity reserved).

We can't really use StockQuant._get_available_quantity because this one
expects a location, while here we don't necessarily know it.

I removed _product_available_not_res_hook which seems to have no
purpose, it does not receive the result of the computation and its own
result is unused.
2021-06-03 17:49:27 +02:00
2021-05-09 01:54:07 +00:00
2021-02-22 12:47:59 +00:00
2021-01-26 16:33:25 +00:00
2021-03-23 09:53:43 +00:00
2021-02-19 17:07:06 +00:00
2021-02-16 13:01:23 +00:00
2021-05-09 01:54:07 +00:00
2021-04-19 13:32:20 +00:00
2021-03-18 17:08:19 +00:00
2021-02-15 12:26:34 +00:00
2020-10-08 21:50:29 +02:00
2020-10-08 21:50:29 +02:00
2021-05-14 19:33:48 +02:00
2020-10-08 21:50:29 +02:00
2021-05-14 19:33:48 +02:00
2020-11-01 22:33:05 +01:00
2020-12-11 20:21:16 +01:00
2020-10-08 21:50:29 +02:00
2020-10-08 21:50:29 +02:00
2020-10-08 21:50:29 +02:00
2021-05-09 01:54:04 +00:00

Runbot Status Build Status codecov Translation Status

stock-logistics-warehouse

TODO: add repo description.

Available addons

addon version summary
scrap_reason_code 14.0.1.0.0 Reason code for scrapping
stock_available 14.0.1.0.2 Stock available to promise
stock_available_immediately 14.0.1.0.0 Ignore planned receptions in quantity available to promise
stock_demand_estimate 14.0.1.1.0 Allows to create demand estimates.
stock_demand_estimate_matrix 14.0.1.0.0 Allows to create demand estimates.
stock_free_quantity 14.0.1.0.0 Stock Free Quantity
stock_helper 14.0.1.0.0 Add methods shared between various stock modules
stock_inventory_preparation_filter 14.0.1.0.0 More filters for inventory adjustments
stock_location_children 14.0.1.0.0 Add relation between stock location and all its children
stock_location_lockdown 14.0.1.0.0 Prevent to add stock on locked locations
stock_location_position 14.0.1.0.0 Add coordinate attributes on stock location.
stock_move_common_dest 14.0.1.0.0 Adds field for common destination moves
stock_move_location 14.0.1.0.0 This module allows to move all stock in a stock location to an other one.
stock_packaging_calculator 14.0.1.0.1 Compute product quantity to pick by packaging
stock_pull_list 14.0.1.0.0 The pull list checks the stock situation and calculates needed quantities.
stock_request 14.0.1.0.1 Internal request for stock
stock_warehouse_calendar 14.0.1.0.1 Adds a calendar to the Warehouse

Licenses

This repository is licensed under AGPL-3.0.

However, each module can have a totally different license, as long as they adhere to OCA policy. Consult each module's __manifest__.py file, which contains a license key that explains its license.


OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

Description
Odoo Warehouse Management Addons
Readme 142 MiB
Languages
HTML 50.9%
Python 48.2%
JavaScript 0.8%
SCSS 0.1%