• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Vauxoo / stock-logistics-warehouse / 12 / 4
92%
8.0: 85%

Build:
Build:
LAST BUILD BRANCH: 11.0
DEFAULT BRANCH: 8.0
Ran 04 Apr 2018 02:08PM UTC
Files 23
Run time 1s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

29 Mar 2018 04:03PM UTC coverage: 94.746%. First build
TESTS=1 ODOO_REPO="odoo/odoo" LINT_CHECK="0"

push

travis-ci

jbeficent
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.

559 of 590 relevant lines covered (94.75%)

0.95 hits per line

Source Files on job 12.4 (TESTS=1 ODOO_REPO="odoo/odoo" LINT_CHECK="0")
  • Tree
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 1
  • Travis Job 12.4
  • 089605e4 on github
  • Next Job for TESTS=1 ODOO_REPO="odoo/odoo" LINT_CHECK="0" on 11.0 (#14.4)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc