[IMP] stock_realign_move_and_quants: inventory on stockable products

Some products may have existing stock moves while not being
of type product (those product where of type 'product' before).
This commit is contained in:
robin.keunen
2021-10-26 15:59:41 +02:00
committed by Robin Keunen
parent 2c6d917a8d
commit 4ce7fbc7d4

View File

@@ -17,8 +17,11 @@ WITH product AS
(
SELECT DISTINCT product_id
FROM stock_move
WHERE state = 'done'
AND create_date > %(start_date)s
JOIN product_product pp ON pp.id = stock_move.product_id
JOIN product_template pt ON pt.id = pp.product_tmpl_id
WHERE stock_move.state = 'done'
AND stock_move.create_date > %(start_date)s
AND pt.type = 'product'
),
location AS (SELECT id AS location_id, usage FROM stock_location),
error_move_lines AS (