Files
odoo_source/addons/stock/tests/__init__.py
T
Nicolas Galler 0d2aa75977 [FIX] stock: correct product_qty filter in forecast inventory report
Behavior prior to the fix:

- when adding a filter on "Quantity < 0" (or > 0) on the forecast
inventory report the quantity reported becomes incorrect: for example if
there is a restock on Tuesday and a shipment on Friday that drives the
forecasted quantity into a negative, the forecasted inventory report
instead reports a negative quantity on Monday.
- the problem occurs because the view the report is based on is built
using positive and negative entries that are supposed to cancel each
other when accounting for stock items (quant).  This way the quantity is
reported as 0 before the quant is moved in the inventory (there is a
positive entry for the quant, and a negative entry for the move up to
the move effective date).  But when a filter on quantity is placed the
"cancelling" entries are not loaded and the report ends up with just the
negative value

Behavior after the fix:

- the quantities are reported as expected: with a negative on Friday,
and 0 on the days before
- to achieve this the view was modified to perform the grouping of
forecast entries inside of the view.  This way we have one row per
product / day / state and we don't risk selecting only part of the
report.
- as the view is only read in aggregate there will not be any visible
changes to its consumers

opw-2379098

closes odoo/odoo#62574

X-original-commit: c16d4b5e7b9181c2c792f595a117de10510d45be
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: Nicolas Galler <ngaller@users.noreply.github.com>
2020-11-30 07:28:47 +00:00

22 lines
619 B
Python

# -*- coding: utf-8 -*-
from . import test_stock_flow
from . import test_product
from . import test_warehouse
from . import test_stock_location_search
from . import test_quant
from . import test_quant_inventory_mode
from . import test_generate_serial_numbers
from . import test_inventory
from . import test_move
from . import test_move2
from . import test_multicompany
from . import test_robustness
from . import test_packing
from . import test_packing_neg
from . import test_proc_rule
from . import test_wise_operator
from . import test_report
from . import test_report_stock_quantity
from . import test_report_tours