[FIX] set active=true in anlysis report

bzr revid: kjo@tinyerp.com-20111109124220-xllj7xr4yh4krvz7
This commit is contained in:
Kuldeep Joshi (OpenERP) 2011-11-09 18:12:20 +05:30
parent c5727fbb9c
commit 9b457c2bcd
12 changed files with 34 additions and 7 deletions

View File

@ -149,7 +149,9 @@ class account_entries_report(osv.osv):
left join account_account a on (l.account_id = a.id)
left join account_move am on (am.id=l.move_id)
left join account_period p on (am.period_id=p.id)
where l.state != 'draft'
left join product_product pr on (l.product_id=pr.id)
left join res_partner rp on (l.partner_id=rp.id)
where l.state != 'draft' and a.active='true' and rp.active='true' and pr.active='true'
)
""")
account_entries_report()

View File

@ -162,10 +162,13 @@ class account_invoice_report(osv.osv):
left join account_invoice as ai ON (ai.id=ail.invoice_id)
left join product_product pr on (pr.id=ail.product_id)
left join product_template pt on (pt.id=pr.product_tmpl_id)
left join product_uom u on (u.id=ail.uos_id),
left join product_uom u on (u.id=ail.uos_id)
left join res_partner rp on (ai.partner_id=rp.id)
left join account_account aa on (ail.account_id=aa.id),
res_currency_rate cr
where cr.id in (select id from res_currency_rate cr2 where (cr2.currency_id = ai.currency_id)
and ((ai.date_invoice is not null and cr.name <= ai.date_invoice) or (ai.date_invoice is null and cr.name <= NOW())) limit 1)
and rp.active='true' and pr.active='true' and aa.active='true'
group by ail.product_id,
ai.date_invoice,
ai.id,

View File

@ -103,7 +103,7 @@ class sale_receipt_report(osv.osv):
left join account_voucher as av on (av.id=avl.voucher_id)
left join res_partner as rp ON (rp.id=av.partner_id)
left join account_journal as aj ON (aj.id=av.journal_id)
where av.type='sale' and aj.type in ('sale','sale_refund')
where av.type='sale' and aj.type in ('sale','sale_refund') and rp.active='true'
group by
av.date,
av.id,

View File

@ -86,8 +86,9 @@ class report_auction(osv.osv):
auction_lots al,
auction_dates ad,
auction_deposit ade
left join res_partner rp on (ade.partner_id=rp.id)
where
ad.id=al.auction_id and ade.id=al.bord_vnd_id
ad.id=al.auction_id and ade.id=al.bord_vnd_id and rp.active='true'
group by
ad.auction1,
al.ach_uid,

View File

@ -100,6 +100,11 @@ 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)
LEFT JOIN
product_product p ON (e.product_id=p.id)
LEFT JOIN
res_partner rp ON (e.main_speaker_id=rp.id)
WHERE c.active = 'true' and p.active='true' and rp.active='true'
GROUP BY
to_char(e.date_begin, 'YYYY'),
to_char(e.date_begin, 'MM'),

View File

@ -100,6 +100,8 @@ class hr_expense_report(osv.osv):
from hr_expense_line l
left join hr_expense_expense s on (s.id=l.expense_id)
left join product_uom u on (u.id=l.uom_id)
left join product_product pp on (pp.id=l.product_id)
where pp.active='true'
group by
date_trunc('day',s.date),
to_char(date_trunc('day',s.create_date), 'YYYY'),

View File

@ -99,6 +99,8 @@ class hr_recruitment_report(osv.osv):
extract('epoch' from (s.date_closed-s.create_date))/(3600*24) as delay_close,
count(*) as nbr
from hr_applicant s
left join res_partner rp on (s.partner_id=rp.id)
where rp.active='true'
group by
to_char(s.create_date, 'YYYY'),
to_char(s.create_date, 'MM'),

View File

@ -68,6 +68,10 @@ class hr_timesheet_report(osv.osv):
from
hr_analytic_timesheet as t
left join account_analytic_line as l ON (t.line_id=l.id)
left join product_product as pp on (l.product_id=pp.id)
left join account_account as aa on (l.general_account_id=aa.id)
left join res_users as u on (l.user_id= u.id)
where pp.active='true' and aa.active='true' and u.active='true'
group by
l.date,
l.account_id,

View File

@ -98,6 +98,9 @@ class timesheet_report(osv.osv):
from account_analytic_line as aal
left join hr_analytic_timesheet as hat ON (hat.line_id=aal.id)
left join hr_timesheet_sheet_sheet as htss ON (hat.line_id=htss.id)
left join account_account as aa on (aal.general_account_id=aa.id)
left join product_product as pp on (aal.product_id=pp.id)
where aa.active='true' and pp.active='true'
group by
to_char(htss.date_current,'YYYY'),
to_char(htss.date_current,'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

@ -77,6 +77,9 @@ class pos_order_report(osv.osv):
left join pos_order s on (s.id=l.order_id)
left join product_template pt on (pt.id=l.product_id)
left join product_uom u on (u.id=pt.uom_id)
left join res_partner rp on (s.partner_id=rp.id)
left join product_product pp on (pp.id=l.product_id)
where rp.active='true' and pp.active='true'
group by
to_char(s.date_order, 'dd-MM-YYYY'),to_char(s.date_order, 'YYYY'),to_char(s.date_order, 'MM'),
to_char(s.date_order, 'YYYY-MM-DD'), s.partner_id,s.state,

View File

@ -129,14 +129,14 @@ class report_stock_move(osv.osv):
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)
LEFT JOIN res_partner rp on(sm.partner_id = rp.id)
where pp.active = 'true' and rp.active='true' and sl.active='true'
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,
@ -189,6 +189,7 @@ CREATE OR REPLACE view report_stock_inventory AS (
LEFT JOIN product_uom pu2 ON (m.product_uom=pu2.id)
LEFT JOIN product_uom u ON (m.product_uom=u.id)
LEFT JOIN stock_location l ON (m.location_id=l.id)
WHERE pp.active = 'true' and l.active='true'
GROUP BY
m.id, m.product_id, m.product_uom, pt.categ_id, m.address_id, m.location_id, m.location_dest_id,
m.prodlot_id, m.date, m.state, l.usage, m.company_id, pt.uom_id
@ -210,6 +211,7 @@ CREATE OR REPLACE view report_stock_inventory AS (
LEFT JOIN product_uom pu2 ON (m.product_uom=pu2.id)
LEFT JOIN product_uom u ON (m.product_uom=u.id)
LEFT JOIN stock_location l ON (m.location_dest_id=l.id)
WHERE pp.active = 'true' and l.active='true'
GROUP BY
m.id, m.product_id, m.product_uom, pt.categ_id, m.address_id, m.location_id, m.location_dest_id,
m.prodlot_id, m.date, m.state, l.usage, m.company_id, pt.uom_id