[IMP]:hr_recruitment:Improved SQL report(Recruitment).

bzr revid: apa@tinyerp.com-20100412054217-t89847tprlt65rr8
This commit is contained in:
apa-tiny
2010-04-12 11:12:17 +05:30
parent 06dd94c8a9
commit ae9d09a067
2 changed files with 31 additions and 4 deletions
@@ -31,6 +31,7 @@ class hr_recruitment_report(osv.osv):
_rec_name = 'date'
_columns = {
'date': fields.datetime('Date', readonly=True),
'date_closed': fields.datetime('Closed', readonly=True),
'job_id': fields.many2one('hr.job', 'Applied Job',readonly=True),
'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('section_id','=',section_id),('object_id.model', '=', 'hr.applicant')]",readonly=True),
'type_id': fields.many2one('crm.case.resource.type', 'Degree', domain="[('section_id','=',section_id),('object_id.model', '=', 'hr.applicant')]"),
@@ -46,6 +47,7 @@ class hr_recruitment_report(osv.osv):
select
min(s.id) as id,
s.date as date,
s.date_closed,
to_char(s.date, 'YYYY') as name,
to_char(s.date, 'MM') as month,
s.state,
@@ -59,8 +61,16 @@ class hr_recruitment_report(osv.osv):
count(*) as nbr
from hr_applicant s
group by
s.date,s.state,s.company_id,s.user_id,s.stage_id,s.type_id,s.priority,
s.job_id,s.department_id
s.date,
s.state,
s.company_id,
s.user_id,
s.stage_id,
s.type_id,
s.priority,
s.date_closed,
s.job_id,
s.department_id
)
""")
hr_recruitment_report()
@@ -50,8 +50,6 @@
help="Recruitments of this month"/>
<separator orientation="vertical"/>
<filter string="Current" icon="terp-hr" domain="[('state','in',('open','draft'))]"/>
<filter string="Won" icon="terp-hr" domain="[('state','=','done')]"/>
<filter string="Lost" icon="terp-hr" domain="[('state','=','cancel')]"/>
<separator orientation="vertical"/>
<field name="company_id" widget="selection"/>
<field name="user_id" widget="selection">
@@ -63,6 +61,22 @@
</group>
<newline/>
<group expand="1" string="Extended options..." colspan="10" col="12">
<filter icon="terp-hr"
string="New"
domain="[('state','=','draft')]"/>
<filter icon="terp-hr"
string="In Progress"
domain="[('state','=','open')]"/>
<filter icon="terp-hr"
string="Pending"
domain="[('state','=','pending')]"/>
<filter icon="terp-hr"
string="Hired"
domain="[('state','=','done')]"/>
<filter icon="terp-hr"
string="Refused"
domain="[('state','=','cancel')]"/>
<newline/>
<filter icon="terp-hr"
string="Not Good"
domain="[('priority','=','5')]"/>
@@ -78,6 +92,9 @@
<filter icon="terp-hr"
string="Excellent"
domain="[('priority','=','1')]"/>
<newline/>
<field name="date"/>
<field name="date_closed"/>
</group>
<newline/>