[MERGE] lp:885610 (fix all analysis reports by filtering out non-active items)

bzr revid: rco@openerp.com-20111129103537-bi1v2c42ukoa48tw
This commit is contained in:
Raphael Collet 2011-11-29 11:35:37 +01:00
commit fac6c3538e
9 changed files with 8 additions and 6 deletions

View File

@ -147,6 +147,7 @@ class crm_lead_report(osv.osv):
extract('epoch' from (c.date_open-c.create_date))/(3600*24) as delay_open
FROM
crm_lead c
WHERE c.active = 'true'
)""")
crm_lead_report()

View File

@ -97,6 +97,7 @@ class crm_fundraising_report(osv.osv):
avg(extract('epoch' from (c.date_closed-c.create_date)))/(3600*24) as delay_close
from
crm_fundraising c
where c.active = 'true'
group by to_char(c.date, 'YYYY'), to_char(c.date, 'MM'),\
c.state, c.user_id,c.section_id,c.categ_id,type_id,c.partner_id,c.company_id,
c.create_date,to_char(c.date, 'YYYY-MM-DD')

View File

@ -101,6 +101,7 @@ class crm_helpdesk_report(osv.osv):
abs(avg(extract('epoch' from (c.date_deadline - c.date_closed)))/(3600*24)) as delay_expected
from
crm_helpdesk c
where c.active = 'true'
group by to_char(c.date, 'YYYY'), to_char(c.date, 'MM'),to_char(c.date, 'YYYY-MM-DD'),\
c.state, c.user_id,c.section_id,c.priority,\
c.partner_id,c.company_id,c.date_deadline,c.create_date,c.date,c.date_closed,\

View File

@ -100,6 +100,7 @@ class report_event_registration(osv.osv):
event_registration c ON (e.id=c.event_id)
LEFT JOIN
event_type t ON (e.type=t.id)
WHERE c.active = 'true'
GROUP BY
to_char(e.date_begin, 'YYYY'),
to_char(e.date_begin, 'MM'),

View File

@ -109,7 +109,7 @@ class report_membership(osv.osv):
LEFT JOIN membership_membership_line ml ON (ml.partner = p.id)
LEFT JOIN account_invoice_line il ON (ml.account_invoice_line = il.id)
LEFT JOIN account_invoice ai ON (il.invoice_id = ai.id)
WHERE p.membership_state != 'none'
WHERE p.membership_state != 'none' and p.active = 'true'
GROUP BY
p.id,
p.user_id,

View File

@ -91,7 +91,7 @@ class report_project_task_user(osv.osv):
(extract('epoch' from (t.date_start-t.create_date)))/(3600*24) as opening_days,
abs((extract('epoch' from (t.date_deadline-t.date_end)))/(3600*24)) as delay_endings_days
FROM project_task t
WHERE t.active = 'true'
GROUP BY
t.id,
remaining_hours,

View File

@ -104,7 +104,7 @@ class project_issue_report(osv.osv):
FROM
project_issue c
WHERE c.categ_id IN (select id from crm_case_categ where object_id in (select id from ir_model where model = 'project.issue'))
WHERE c.active= 'true' and c.categ_id IN (select id from crm_case_categ where object_id in (select id from ir_model where model = 'project.issue'))
)""")
project_issue_report()

View File

@ -159,6 +159,7 @@ class report_stock_lines_date(osv.osv):
left outer join stock_inventory_line l on (p.id=l.product_id)
left join stock_inventory s on (l.inventory_id=s.id)
and s.state = 'done'
where p.active='true'
group by p.id
)""")
report_stock_lines_date()

View File

@ -128,15 +128,12 @@ class report_stock_move(osv.osv):
LEFT JOIN product_uom pu ON (sm.product_uom=pu.id)
LEFT JOIN product_uom pu2 ON (sm.product_uom=pu2.id)
LEFT JOIN product_template pt ON (pp.product_tmpl_id=pt.id)
LEFT JOIN stock_location sl ON (sm.location_id = sl.id)
GROUP BY
sm.id,sp.type, sm.date,sm.address_id,
sm.product_id,sm.state,sm.product_uom,sm.date_expected,
sm.product_id,pt.standard_price, sm.picking_id, sm.product_qty,
sm.company_id,sm.product_qty, sm.location_id,sm.location_dest_id,pu.factor,pt.categ_id, sp.stock_journal_id)
AS al
GROUP BY
al.out_qty,al.in_qty,al.curr_year,al.curr_month,
al.curr_day,al.curr_day_diff,al.curr_day_diff1,al.curr_day_diff2,al.dp,al.location_id,al.location_dest_id,