diff --git a/addons/stock/stock.py b/addons/stock/stock.py index dbf55768b3e..571b9643129 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -2630,7 +2630,7 @@ class report_delivery_products_planned(osv.osv): tools.drop_view_if_exists(cr, 'report_delivery_products_planned') cr.execute(""" create or replace view report_delivery_products_planned as ( - select stock.create_date, min(stock.id) as id, sum(stock.product_qty) as qty, 0 as planned_qty + select stock.create_date as date, min(stock.id) as id, sum(stock.product_qty) as qty, 0 as planned_qty from stock_picking picking inner join stock_move stock on picking.id = stock.picking_id and picking.type = 'out' @@ -2639,14 +2639,12 @@ class report_delivery_products_planned(osv.osv): union - select stock.date, min(stock.id), 0 as actual_qty, sum(stock.product_qty) as planned_qty + select stock.date as date, min(stock.id), 0 as actual_qty, sum(stock.product_qty) as planned_qty from stock_picking picking inner join stock_move stock on picking.id = stock.picking_id and picking.type = 'out' where stock.date between (select cast(date_trunc('week', current_date) as date)) and (select cast(date_trunc('week', current_date) as date) + 7) - group by stock.date - - + group by stock.date ) """)