[FIX] stock: Error while opening dashboard.

bzr revid: uco@tinyerp.com-20100929045219-a2q4dqsbu3el14yk
This commit is contained in:
uco (Open ERP)
2010-09-29 10:22:19 +05:30
parent 11cc4b59d4
commit bb17e729bf
+3 -5
View File
@@ -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
)
""")