[IMP] hr_recruitement view
bzr revid: fp@tinyerp.com-20100228194419-sqkugdku2skoz088
This commit is contained in:
parent
6655ee290c
commit
7a22b5bf8b
|
@ -20,13 +20,12 @@
|
|||
#
|
||||
##############################################################################
|
||||
|
||||
|
||||
{
|
||||
'name': 'CRM Stuff in Job ',
|
||||
'name': 'HR - Recruitement',
|
||||
'version': '1.0',
|
||||
'category': 'Generic Modules/CRM & SRM',
|
||||
'description': """
|
||||
This module provide Store the Job
|
||||
Manages job position and recruitement process.
|
||||
""",
|
||||
'author': 'Tiny',
|
||||
'website': 'http://www.openerp.com',
|
||||
|
|
|
@ -22,35 +22,33 @@
|
|||
from osv import fields,osv,orm
|
||||
from crm import crm
|
||||
|
||||
AVAILABLE_STATES = [
|
||||
('draft','New'),
|
||||
('open','In Progress'),
|
||||
('cancel', 'Refused'),
|
||||
('done', 'Hired'),
|
||||
('pending','Pending')
|
||||
]
|
||||
|
||||
class crm_applicant(osv.osv):
|
||||
_name = "crm.applicant"
|
||||
_description = "Applicant Cases"
|
||||
_order = "id desc"
|
||||
_inherit ='crm.case'
|
||||
_columns = {
|
||||
'date_closed': fields.datetime('Closed', readonly=True),
|
||||
'date': fields.datetime('Date'),
|
||||
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
|
||||
'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.applicant')]"),
|
||||
'planned_revenue': fields.float('Planned Revenue'),
|
||||
'planned_cost': fields.float('Planned Costs'),
|
||||
'probability': fields.float('Probability (%)'),
|
||||
'partner_name': fields.char("Employee's Name", size=64),
|
||||
'partner_name2': fields.char('Employee Email', size=64),
|
||||
'partner_phone': fields.char('Phone', size=32),
|
||||
'partner_mobile': fields.char('Mobile', size=32),
|
||||
'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.applicant')]"),
|
||||
'type_id': fields.many2one('crm.case.resource.type', 'Type Name', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.applicant')]"),
|
||||
'duration': fields.float('Duration'),
|
||||
'ref' : fields.reference('Reference', selection=crm._links_get, size=128),
|
||||
'ref2' : fields.reference('Reference 2', selection=crm._links_get, size=128),
|
||||
'canal_id': fields.many2one('res.partner.canal', 'Channel',help="The channels represent the different communication modes available with the customer." \
|
||||
" With each commercial opportunity, you can indicate the canall which is this opportunity source."),
|
||||
'som': fields.many2one('res.partner.som', 'State of Mind', help="The minds states allow to define a value scale which represents" \
|
||||
"the partner mentality in relation to our services.The scale has" \
|
||||
"to be created with a factor for each level from 0 (Very dissatisfied) to 10 (Extremely satisfied)."),
|
||||
'phonecall_id':fields.many2one ('crm.phonecall', 'Phonecall'),
|
||||
'department_id':fields.many2one('hr.department','Department'),
|
||||
'date_closed': fields.datetime('Closed', readonly=True),
|
||||
'date': fields.datetime('Date'),
|
||||
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Appreciation'),
|
||||
'job_id': fields.many2one('hr.job', 'Applied Job'),
|
||||
'salary_proposed': fields.float('Proposed Salary'),
|
||||
'salary_expected': fields.float('Expected Salary'),
|
||||
'availability': fields.integer('Availability (Days)'),
|
||||
'partner_name': fields.char("Applicant's Name", size=64),
|
||||
'partner_phone': fields.char('Phone', size=32),
|
||||
'partner_mobile': fields.char('Mobile', size=32),
|
||||
'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.applicant')]"),
|
||||
'type_id': fields.many2one('crm.case.resource.type', 'Degree', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.applicant')]"),
|
||||
'department_id':fields.many2one('hr.department','Department'),
|
||||
'state': fields.selection(AVAILABLE_STATES, 'State', size=16, readonly=True),
|
||||
}
|
||||
|
||||
crm_applicant()
|
||||
|
|
|
@ -6,50 +6,54 @@
|
|||
# Job Categories
|
||||
# ------------------------------------------------------
|
||||
|
||||
<record id="crm_job_categ_action" model="ir.actions.act_window">
|
||||
<record id="hr_job_categ_action" model="ir.actions.act_window">
|
||||
<field name="name">Applicant Categories</field>
|
||||
<field name="res_model">crm.case.categ</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="crm.crm_case_categ_tree-view"/>
|
||||
<field name="domain">[('object_id.model', '=', 'crm.applicant')]</field>
|
||||
<field name="context">{'object_id':'crm.applicant'}</field>
|
||||
<field name="domain">[('object_id.model', '=', 'crm.applicant')]</field>
|
||||
<field name="context">{'object_id':'crm.applicant'}</field>
|
||||
</record>
|
||||
# ------------------------------------------------------
|
||||
# Stage
|
||||
# ------------------------------------------------------
|
||||
<record id="crm_job_stage_act" model="ir.actions.act_window">
|
||||
<field name="name">Applicant Stages</field>
|
||||
<field name="res_model">crm.case.stage</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="crm.crm_case_stage_tree"/>
|
||||
<field name="domain">[('object_id.model', '=', 'crm.applicant')]</field>
|
||||
<field name="context">{'object_id':'crm.applicant'}</field>
|
||||
</record>
|
||||
<menuitem action="crm_job_stage_act" id="menu_crm_job_stage_act" parent="crm.menu_crm_case_stage"/>
|
||||
# Stage
|
||||
# ------------------------------------------------------
|
||||
<record id="hr_job_stage_act" model="ir.actions.act_window">
|
||||
<field name="name">Applicant Stages</field>
|
||||
<field name="res_model">crm.case.stage</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="crm.crm_case_stage_tree"/>
|
||||
<field name="domain">[('object_id.model', '=', 'crm.applicant')]</field>
|
||||
<field name="context">{'object_id':'crm.applicant'}</field>
|
||||
</record>
|
||||
<menuitem action="hr_job_stage_act" id="menu_hr_job_stage_act" parent="crm.menu_crm_case_stage"/>
|
||||
|
||||
# ------------------------------------------------------
|
||||
# Jobs
|
||||
# ------------------------------------------------------
|
||||
|
||||
<record model="ir.ui.view" id="crm_case_tree_view_job">
|
||||
<field name="name">Jobs - Recruitment Tree</field>
|
||||
<field name="name">Applicants</field>
|
||||
<field name="model">crm.applicant</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Jobs - Recruitment Tree" colors="red:state=='open';black:state in ('draft', 'cancel','done','pending')">
|
||||
<field name="id"/>
|
||||
<field name="name" string="Description"/>
|
||||
<field name="department_id"/>
|
||||
<field name="partner_name" string="Name"/>
|
||||
<field name="email_from" string="Candidate Email"/>
|
||||
<field name="partner_phone" string="Candidate Phone"/>
|
||||
<field name="categ_id" string="Applied Job" select="1"/>
|
||||
<tree string="Applicants" colors="grey:state in ('cancel','done');blue:state=='pending'">
|
||||
<field name="create_date"/>
|
||||
<field name="partner_name"/>
|
||||
<field name="email_from"/>
|
||||
<field name="partner_phone"/>
|
||||
<field name="job_id"/>
|
||||
<field name="stage_id"/>
|
||||
<field name="priority" string="Appreciation"/>
|
||||
<button name="stage_previous" string="Previous" states="open,pending" type="object" icon="gtk-go-back"/>
|
||||
<button name="stage_next" string="Next" states="open,pending" type="object" icon="gtk-go-forward"/>
|
||||
<field name="priority"/>
|
||||
<field name="type_id" invisible="1"/>
|
||||
<field name="availability" invisible="1"/>
|
||||
<field name="department_id" invisible="context.get('invisible_department', True)"/>
|
||||
<field name="user_id"/>
|
||||
<field name="state"/>
|
||||
<button name="case_open" string="Open" states="draft,pending" type="object" icon="gtk-go-forward"/>
|
||||
<button name="case_open" string="In Progress" states="draft,pending" type="object" icon="gtk-go-forward"/>
|
||||
<button name="case_pending" string="Pending" states="draft,open" type="object" icon="gtk-media-pause"/>
|
||||
<button name="case_close" string="Hired" states="open,draft,pending" type="object" icon="terp-partner"/>
|
||||
<button name="case_close" string="Hired" states="open,draft,pending" type="object" icon="terp-partner"/>
|
||||
<button name="case_cancel" string="Refused" states="draft,open,pending" type="object" icon="gtk-cancel"/>
|
||||
|
||||
</tree>
|
||||
|
@ -63,76 +67,71 @@
|
|||
<field name="arch" type="xml">
|
||||
<form string="Jobs - Recruitment Form">
|
||||
<group colspan="4" col="7">
|
||||
<field name="name" string="Description" colspan="2"/>
|
||||
<field name="department_id" widget="selection"/>
|
||||
<field name="user_id" string="Responsible" select="2"/>
|
||||
<field name="name" string="Subject"/>
|
||||
<label string="Stage: " align="1.0"/>
|
||||
<group colspan="1" col="2">
|
||||
<field name="stage_id" nolabel="1"/>
|
||||
<button icon="gtk-go-forward" string="" name="stage_next" type="object"/>
|
||||
</group>
|
||||
<field name="user_id"/>
|
||||
<button string="Schedule a Phone Call"
|
||||
name="%(wizard_crm_job_reschedule_phone_call)d" icon="gtk-redo" type="action"/>
|
||||
name="%(wizard_hr_job_reschedule_phone_call)d" icon="gtk-redo" type="action"/>
|
||||
<newline/>
|
||||
<label string="Stage: " align="1.0"/>
|
||||
<group colspan="1" col="2">
|
||||
<field name="stage_id" select="1" nolabel="1"/>
|
||||
<button icon="gtk-go-forward" string="" name="stage_next" type="object"/>
|
||||
</group>
|
||||
<field name="partner_name" string="Candidate Name"/>
|
||||
<field name="partner_phone"/>
|
||||
<button name="%(wizard_crm_job_meeting_set)d" string="Schedule Meeting" icon="terp-crm" type="action"/>
|
||||
<field name="partner_name"/>
|
||||
<field name="job_id"/>
|
||||
<field name="department_id" widget="selection"/>
|
||||
<button name="%(wizard_hr_job_meeting_set)d" string="Schedule Meeting" icon="terp-crm" type="action"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Job Info">
|
||||
<separator colspan="4" string="Communications"/>
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id, email_from)" />
|
||||
<field name="partner_address_id" string="Contact" on_change="onchange_partner_address_id(partner_address_id, email_from)" colspan="1"/>
|
||||
<newline/>
|
||||
<field name="partner_mobile"/>
|
||||
<field name="email_from" string="Candidate Email" widget="email"/>
|
||||
<button string="Convert to Partner"
|
||||
icon="terp-partner" name="%(wizard_crm_job_partner_create)d"
|
||||
type="action" attrs="{'invisible':[('partner_id','!=',False)]}"
|
||||
/>
|
||||
<newline/>
|
||||
<separator colspan="4" string="Contract Data"/>
|
||||
<field name="probability" string="Availability (weeks)"/>
|
||||
<newline/>
|
||||
<field name="planned_cost" string="Expected Salary"/>
|
||||
<field name="planned_revenue" string="Proposed Salary"/>
|
||||
<field name="categ_id" string="Applied Job" select="1" />
|
||||
<field name="type_id" string="Degree" select="1"/>
|
||||
<separator colspan="4" string="Qualication"/>
|
||||
<field name="priority" string="Appreciation" select="2"/>
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="2" string="Contact"/>
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id, email_from)" />
|
||||
<field name="partner_address_id" on_change="onchange_partner_address_id(partner_address_id, email_from)"/>
|
||||
<field name="email_from"/>
|
||||
<field name="partner_phone"/>
|
||||
<field name="partner_mobile"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="2" string="Contract Data"/>
|
||||
<field name="availability"/>
|
||||
<field name="salary_expected"/>
|
||||
<field name="salary_proposed"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="2" string="Qualification"/>
|
||||
<field name="type_id"/>
|
||||
<field name="priority" string="Appreciation"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="2" string="Dates"/>
|
||||
<field name="create_date"/>
|
||||
<field name="write_date"/>
|
||||
<field name="date_closed"/>
|
||||
</group>
|
||||
|
||||
<separator colspan="4" string="Status"/>
|
||||
<group col="8" colspan="4">
|
||||
<field name="state" select="1"/>
|
||||
<button name="case_open" string="Open" states="draft,pending" type="object" icon="gtk-go-forward"/>
|
||||
<field name="state"/>
|
||||
<button name="case_open" string="In Progress" states="draft,pending" type="object" icon="gtk-go-forward"/>
|
||||
<button name="case_pending" string="Pending" states="draft,open" type="object" icon="gtk-media-pause"/>
|
||||
<button name="case_close" string="Hired" states="open,draft,pending" type="object" icon="terp-partner"/>
|
||||
<button name="case_cancel" string="Refused" states="draft,open,pending" type="object" icon="gtk-cancel"/>
|
||||
<button name="case_reset" string="Reset to Draft" states="done,cancel" type="object" icon="gtk-convert"/>
|
||||
<button name="case_reset" string="Reset to New" states="done,cancel" type="object" icon="gtk-convert"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Internal Notes">
|
||||
<field name="description" nolabel="1" colspan="4"/>
|
||||
</page>
|
||||
<page string="History" groups="base.group_extended">
|
||||
<field name="id" select="1"/>
|
||||
<field name="id"/>
|
||||
<field name="active"/>
|
||||
<field name="canal_id"/>
|
||||
<separator colspan="4" string="Dates"/>
|
||||
<field name="create_date"/>
|
||||
<field name="date_closed"/>
|
||||
<separator colspan="4" string="References"/>
|
||||
<field name="ref" colspan="4"/>
|
||||
<field name="ref2" colspan="4"/>
|
||||
|
||||
<field name="log_ids" nolabel="1" colspan="4">
|
||||
<form string="Actions">
|
||||
<separator string="Action Information" colspan="4"/>
|
||||
<field name="name" colspan="4"/>
|
||||
<field name="date"/>
|
||||
<field name="user_id"/>
|
||||
<field name="som"/>
|
||||
<field name="canal_id"/>
|
||||
</form>
|
||||
</field>
|
||||
</page>
|
||||
|
@ -145,11 +144,10 @@
|
|||
<group col="7" colspan="4">
|
||||
<field name="date"/>
|
||||
<field name="email"/>
|
||||
<field name="canal_id"/>
|
||||
<button
|
||||
string="Add a CC"
|
||||
name="%(crm.action_view_crm_email_add_cc_wizard)d"
|
||||
icon="gtk-add" type="action"/>
|
||||
string="Add a CC"
|
||||
name="%(crm.action_view_crm_email_add_cc_wizard)d"
|
||||
icon="gtk-add" type="action"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<field name="description" colspan="4" nolabel="1"/>
|
||||
|
@ -175,59 +173,67 @@
|
|||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Cases By Stage and Estimates" type="bar" orientation="vertical">
|
||||
<field name="categ_id"/>
|
||||
<field name="planned_cost" operator="+"/>
|
||||
<field name="job_id"/>
|
||||
<field name="salary_expected" operator="+"/>
|
||||
<field name="state" group="True"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_crm_case_jobs_filter" model="ir.ui.view">
|
||||
<field name="name">Jobs - Recruitment Search</field>
|
||||
<field name="model">crm.applicant</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Jobs">
|
||||
<group col="7" colspan="1">
|
||||
<filter icon="gtk-home" string=" Today "
|
||||
separator="1"
|
||||
domain="[('date','=',time.strftime('%%Y-%%m-%%d'))]"
|
||||
help="Todays's Jobs"
|
||||
/>
|
||||
<filter icon="gtk-media-rewind"
|
||||
string=" 7 Days " separator="1"
|
||||
domain="[('date','<', time.strftime('%%Y-%%m-%%d')), ('date','>=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Jobs during last 7 days"
|
||||
/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="gtk-new" string="New Jobs"
|
||||
domain="[('stage_id.name','=','Initial Jobs Demand')]"
|
||||
separator="1" help="All Initial Jobs"
|
||||
/>
|
||||
<filter icon="gtk-yes" string="Open Jobs"
|
||||
domain="[('state','=','open')]"
|
||||
separator="1" help="Open Jobs"
|
||||
/>
|
||||
<filter icon="gtk-media-pause" string="Pending Jobs"
|
||||
domain="[('state','=','pending')]"
|
||||
separator="1" help="Pending Jobs"
|
||||
/>
|
||||
</group>
|
||||
<separator orientation="vertical"/>
|
||||
<group col="4" colspan="2">
|
||||
<field name="name" select='1' string="Name"/>
|
||||
<field name="email_from" select='1' string="Email"/>
|
||||
<field name="user_id" select="1" widget="selection"/>
|
||||
</group>
|
||||
<field name="department_id" select="1" widget="selection" string="Department">
|
||||
<filter icon="terp-crm"
|
||||
domain="[('department_id','=',context.get('department_id',False))]"
|
||||
help="My Department"/>
|
||||
|
||||
</field>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<field name="name">Jobs - Recruitment Search</field>
|
||||
<field name="model">crm.applicant</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Jobs">
|
||||
<filter icon="gtk-new" string="Current"
|
||||
domain="[('state','in',('draft','open'))]"
|
||||
help="All new and in progress jobs"
|
||||
default="1"
|
||||
/>
|
||||
<filter icon="gtk-new" string="New"
|
||||
domain="[('state','=','draft')]"
|
||||
help="All Initial Jobs"
|
||||
/>
|
||||
<filter icon="gtk-yes" string="In Progress"
|
||||
domain="[('state','=','open')]"
|
||||
help="Open Jobs"
|
||||
/>
|
||||
<filter icon="gtk-media-pause" string="Pending"
|
||||
domain="[('state','=','pending')]"
|
||||
help="Pending Jobs"
|
||||
/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="partner_name"/>
|
||||
<field name="email_from"/>
|
||||
<field name="job_id" widget="selection"/>
|
||||
<field name="user_id" widget="selection">
|
||||
<filter domain="[('user_id','=',uid)]" help="My Recruitements" icon="gtk-execute" default="1"/>
|
||||
<filter domain="[('user_id','=',False)]" help="Unassigned Recruitements" icon="gtk-execute" separator="1"/>
|
||||
</field>
|
||||
<field name="department_id" widget="selection" string="Department" context="{'invisible_department': False}">
|
||||
<filter icon="terp-crm" context="{'invisible_department': False}"
|
||||
domain="[('department_id','=',context.get('department_id',False))]"
|
||||
help="My Department"/>
|
||||
</field>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="11" col="20">
|
||||
<filter string="Department" icon="terp-project" domain="[]" context="{'group_by':'department_id'}"/>
|
||||
<filter string="Responsible" icon="terp-project" domain="[]" context="{'group_by':'user_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Job" icon="terp-project" domain="[]" context="{'group_by':'job_id'}"/>
|
||||
<filter string="Stage" icon="terp-project" domain="[]" context="{'group_by':'stage_id'}"/>
|
||||
<filter string="Degree" icon="terp-project" domain="[]" context="{'group_by':'type_id'}"/>
|
||||
<filter string="Availability" icon="terp-project" domain="[]" context="{'group_by':'availability'}"/>
|
||||
<filter string="State" icon="terp-project" domain="[]" context="{'group_by':'state'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Appreciation" icon="terp-project" domain="[]" context="{'group_by':'priority'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Date" icon="terp-project" domain="[]" context="{'group_by':'create_date'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<openerp>
|
||||
<data>
|
||||
<wizard
|
||||
id="wizard_crm_job_reschedule_phone_call"
|
||||
id="wizard_hr_job_reschedule_phone_call"
|
||||
keyword="client_action_multi"
|
||||
model="crm.applicant"
|
||||
name="crm.applicant.reschedule_phone_call"
|
||||
|
@ -10,7 +10,7 @@
|
|||
string="Schedule Phone Call" />
|
||||
|
||||
<wizard
|
||||
id="wizard_crm_job_meeting_set"
|
||||
id="wizard_hr_job_meeting_set"
|
||||
keyword="client_action_multi"
|
||||
model="crm.applicant"
|
||||
name="crm.applicant.meeting_set"
|
||||
|
@ -18,7 +18,7 @@
|
|||
string="Schedule Meeting"/>
|
||||
|
||||
<wizard
|
||||
id="wizard_crm_job_partner_create"
|
||||
id="wizard_hr_job_partner_create"
|
||||
keyword="client_action_multi"
|
||||
model="crm.applicant"
|
||||
name="crm.applicant.partner_create"
|
||||
|
|
|
@ -7,10 +7,9 @@ class report_crm_applicant_user(osv.osv):
|
|||
_auto = False
|
||||
_inherit = "report.crm.case.user"
|
||||
_columns = {
|
||||
'probability': fields.float('Avg. Probability', readonly=True),
|
||||
'availability': fields.float('Avg. Availability', readonly=True),
|
||||
'amount_revenue': fields.float('Est.Revenue', readonly=True),
|
||||
'amount_costs': fields.float('Est.Cost', readonly=True),
|
||||
'amount_revenue_prob': fields.float('Est. Rev*Prob.', readonly=True),
|
||||
'delay_close': fields.char('Delay to close', size=20, readonly=True),
|
||||
}
|
||||
def init(self, cr):
|
||||
|
@ -27,8 +26,7 @@ class report_crm_applicant_user(osv.osv):
|
|||
count(*) as nbr,
|
||||
sum(planned_revenue) as amount_revenue,
|
||||
sum(planned_cost) as amount_costs,
|
||||
sum(planned_revenue*probability)::decimal(16,2) as amount_revenue_prob,
|
||||
avg(probability)::decimal(16,2) as probability,
|
||||
avg(availability)::decimal(16,2) as availability,
|
||||
to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close
|
||||
from
|
||||
crm_applicant c
|
||||
|
@ -45,8 +43,7 @@ class report_crm_applicant_categ(osv.osv):
|
|||
'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.applicant')]"),
|
||||
'amount_revenue': fields.float('Est.Revenue', readonly=True),
|
||||
'amount_costs': fields.float('Est.Cost', readonly=True),
|
||||
'amount_revenue_prob': fields.float('Est. Rev*Prob.', readonly=True),
|
||||
'probability': fields.float('Avg. Probability', readonly=True),
|
||||
'availability': fields.float('Avg. availability', readonly=True),
|
||||
'delay_close': fields.char('Delay Close', size=20, readonly=True),
|
||||
}
|
||||
|
||||
|
@ -64,8 +61,7 @@ class report_crm_applicant_categ(osv.osv):
|
|||
count(*) as nbr,
|
||||
sum(planned_revenue) as amount_revenue,
|
||||
sum(planned_cost) as amount_costs,
|
||||
sum(planned_revenue*probability)::decimal(16,2) as amount_revenue_prob,
|
||||
avg(probability)::decimal(16,2) as probability,
|
||||
avg(availability)::decimal(16,2) as availability,
|
||||
to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close
|
||||
from
|
||||
crm_applicant c
|
||||
|
|
|
@ -1,42 +1,40 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<!--
|
||||
jobs by user and section
|
||||
-->
|
||||
<!--
|
||||
jobs by user and section
|
||||
-->
|
||||
|
||||
<record id="view_crm_job_user_tree" model="ir.ui.view">
|
||||
<record id="view_hr_job_user_tree" model="ir.ui.view">
|
||||
<field name="name">report.crm.applicant.user.tree</field>
|
||||
<field name="model">report.crm.applicant.user</field>
|
||||
<field name="inherit_id" ref="report_crm.view_crm_case_user_tree"/>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<field name="nbr" position="after">
|
||||
<field name="delay_close"/>
|
||||
<field name="delay_close"/>
|
||||
<field name="amount_revenue"/>
|
||||
<field name="amount_costs"/>
|
||||
<field name="amount_revenue_prob"/>
|
||||
<field name="probability"/>
|
||||
<field name="availability"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_crm_job_user_form" model="ir.ui.view">
|
||||
<record id="view_hr_job_user_form" model="ir.ui.view">
|
||||
<field name="name">report.crm.applicant.user.form</field>
|
||||
<field name="model">report.crm.applicant.user</field>
|
||||
<field name="inherit_id" ref="report_crm.view_crm_case_user_form"/>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<field name="nbr" position="after">
|
||||
<field name="delay_close"/>
|
||||
<field name="delay_close"/>
|
||||
<field name="amount_revenue"/>
|
||||
<field name="amount_costs"/>
|
||||
<field name="amount_revenue_prob"/>
|
||||
<field name="probability"/>
|
||||
<field name="availability"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_crm_job_user_graph" model="ir.ui.view">
|
||||
<record id="view_hr_job_user_graph" model="ir.ui.view">
|
||||
<field name="name">report.crm.applicant.user.graph</field>
|
||||
<field name="model">report.crm.applicant.user</field>
|
||||
<field name="type">graph</field>
|
||||
|
@ -49,7 +47,7 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_crm_job_user_filter" model="ir.ui.view">
|
||||
<record id="view_hr_job_user_filter" model="ir.ui.view">
|
||||
<field name="name">report.crm.applicant.user.select</field>
|
||||
<field name="model">report.crm.applicant.user</field>
|
||||
<field name="inherit_id" ref="report_crm.view_crm_case_user_filter"/>
|
||||
|
@ -60,25 +58,25 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_report_crm_job_user_tree" model="ir.actions.act_window">
|
||||
<record id="action_report_hr_job_user_tree" model="ir.actions.act_window">
|
||||
<field name="name">Applicant by User and Section</field>
|
||||
<field name="res_model">report.crm.applicant.user</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">graph,tree</field>
|
||||
<field name="view_id" ref="view_crm_job_user_graph"/>
|
||||
<field name="search_view_id" ref="view_crm_job_user_filter"/>
|
||||
<field name="view_id" ref="view_hr_job_user_graph"/>
|
||||
<field name="search_view_id" ref="view_hr_job_user_filter"/>
|
||||
</record>
|
||||
<menuitem
|
||||
id="hr.menu_hr_reporting"
|
||||
name="Reporting"
|
||||
parent="hr.menu_hr_root"
|
||||
sequence="40" />
|
||||
<menuitem name="Applicant" id="menu_crm_jobs_tree" parent="hr.menu_hr_reporting" sequence="4"/>
|
||||
<menuitem action="action_report_crm_job_user_tree" id="menu_crm_job_user_tree" parent="menu_crm_jobs_tree"/>
|
||||
<menuitem name="Applicant" id="menu_hr_jobs_tree" parent="hr.menu_hr_reporting" sequence="4"/>
|
||||
<menuitem action="action_report_hr_job_user_tree" id="menu_hr_job_user_tree" parent="menu_hr_jobs_tree"/>
|
||||
|
||||
<!-- # jobs by section and category of case -->
|
||||
|
||||
<record id="view_crm_job_categ_tree" model="ir.ui.view">
|
||||
<record id="view_hr_job_categ_tree" model="ir.ui.view">
|
||||
<field name="name">report.crm.applicant.categ.tree</field>
|
||||
<field name="model">report.crm.applicant.categ</field>
|
||||
<field name="inherit_id" ref="report_crm.view_crm_case_categ_tree"/>
|
||||
|
@ -88,12 +86,11 @@
|
|||
<field name="delay_close"/>
|
||||
<field name="amount_revenue"/>
|
||||
<field name="amount_costs"/>
|
||||
<field name="amount_revenue_prob"/>
|
||||
<field name="probability"/>
|
||||
<field name="availability"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_crm_job_categ_form" model="ir.ui.view">
|
||||
<record id="view_hr_job_categ_form" model="ir.ui.view">
|
||||
<field name="name">report.crm.applicant.categ.form</field>
|
||||
<field name="model">report.crm.applicant.categ</field>
|
||||
<field name="inherit_id" ref="report_crm.view_crm_case_categ_form"/>
|
||||
|
@ -103,13 +100,12 @@
|
|||
<field name="delay_close"/>
|
||||
<field name="amount_revenue"/>
|
||||
<field name="amount_costs"/>
|
||||
<field name="amount_revenue_prob"/>
|
||||
<field name="probability"/>
|
||||
<field name="availability"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_crm_job_categ_graph" model="ir.ui.view">
|
||||
<record id="view_hr_job_categ_graph" model="ir.ui.view">
|
||||
<field name="name">report.crm.applicant.categ.graph</field>
|
||||
<field name="model">report.crm.applicant.categ</field>
|
||||
<field name="type">graph</field>
|
||||
|
@ -122,10 +118,10 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_crm_job_categ_filter" model="ir.ui.view">
|
||||
<record id="view_hr_job_categ_filter" model="ir.ui.view">
|
||||
<field name="name">report.crm.applicant.categ.select</field>
|
||||
<field name="model">report.crm.applicant.categ</field>
|
||||
<field name="inherit_id" ref="report_crm.view_crm_case_categ_filter"/>
|
||||
<field name="inherit_id" ref="report_crm.view_crm_case_categ_filter"/>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<field name="state" position="before">
|
||||
|
@ -133,34 +129,34 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_report_crm_job_categ_tree" model="ir.actions.act_window">
|
||||
<record id="action_report_hr_job_categ_tree" model="ir.actions.act_window">
|
||||
<field name="name">Applicant by Categories and Section</field>
|
||||
<field name="res_model">report.crm.applicant.categ</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">graph,tree</field>
|
||||
<field name="view_id" ref="view_crm_job_categ_graph"/>
|
||||
<field name="search_view_id" ref="view_crm_job_categ_filter"/>
|
||||
<field name="view_id" ref="view_hr_job_categ_graph"/>
|
||||
<field name="search_view_id" ref="view_hr_job_categ_filter"/>
|
||||
</record>
|
||||
<menuitem action="action_report_crm_job_categ_tree" id="menu_crm_job_categ_tree" parent="menu_crm_jobs_tree"/>
|
||||
<menuitem action="action_report_hr_job_categ_tree" id="menu_hr_job_categ_tree" parent="menu_hr_jobs_tree"/>
|
||||
|
||||
<!-- jobs by Section -->
|
||||
|
||||
<record id="view_report_crm_job_section_tree" model="ir.ui.view">
|
||||
<record id="view_report_hr_job_section_tree" model="ir.ui.view">
|
||||
<field name="name">report.crm.applicant.section.tree</field>
|
||||
<field name="model">report.crm.applicant.section</field>
|
||||
<field name="inherit_id" ref="report_crm.view_report_crm_case_section_tree"/>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<field name="nbr_cases" position="after">
|
||||
<field name="avg_answers"/>
|
||||
<field name="perc_done" select="2"/>
|
||||
<field name="avg_answers"/>
|
||||
<field name="perc_done" select="2"/>
|
||||
<field name="perc_cancel" select="2"/>
|
||||
<field name="delay_close"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_report_crm_job_section_graph" model="ir.ui.view">
|
||||
<record id="view_report_hr_job_section_graph" model="ir.ui.view">
|
||||
<field name="name">report.crm.applicant.section.graph</field>
|
||||
<field name="model">report.crm.applicant.section</field>
|
||||
<field name="type">graph</field>
|
||||
|
@ -172,7 +168,7 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_report_crm_job_section_filter" model="ir.ui.view">
|
||||
<record id="view_report_hr_job_section_filter" model="ir.ui.view">
|
||||
<field name="name">report.crm.applicant.section.select</field>
|
||||
<field name="model">report.crm.applicant.section</field>
|
||||
<field name="inherit_id" ref="report_crm.view_report_crm_case_section_filter"/>
|
||||
|
@ -183,15 +179,15 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_report_crm_job_section_tree" model="ir.actions.act_window">
|
||||
<record id="action_report_hr_job_section_tree" model="ir.actions.act_window">
|
||||
<field name="name">Applicant by Section</field>
|
||||
<field name="res_model">report.crm.applicant.section</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">graph,tree</field>
|
||||
<field name="view_id" ref="view_report_crm_job_section_graph"/>
|
||||
<field name="search_view_id" ref="view_report_crm_job_section_filter"/>
|
||||
<field name="view_id" ref="view_report_hr_job_section_graph"/>
|
||||
<field name="search_view_id" ref="view_report_hr_job_section_filter"/>
|
||||
</record>
|
||||
<menuitem action="action_report_crm_job_section_tree" id="menu_crm_job_section_tree" parent="menu_crm_jobs_tree"/>
|
||||
<menuitem action="action_report_hr_job_section_tree" id="menu_hr_job_section_tree" parent="menu_hr_jobs_tree"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -61,32 +61,32 @@ class hr_employee_marital_status(osv.osv):
|
|||
}
|
||||
hr_employee_marital_status()
|
||||
|
||||
class crm_job(osv.osv):
|
||||
|
||||
class hr_job(osv.osv):
|
||||
def _no_of_employee(self, cr, uid, ids, name,args,context=None):
|
||||
res = {}
|
||||
for emp in self.browse(cr, uid, ids):
|
||||
res[emp.id] = str(len(emp.employee_ids))
|
||||
res[emp.id] = len(emp.employee_ids or [])
|
||||
return res
|
||||
|
||||
_name = "crm.job"
|
||||
_description = "Job Information"
|
||||
_name = "hr.job"
|
||||
_description = "Job Description"
|
||||
_columns = {
|
||||
'name': fields.char('Name', size=128, required=True, select=True),
|
||||
'ref': fields.char('Code', size=64),
|
||||
'name': fields.char('Job Name', size=128, required=True, select=True),
|
||||
'expected_employees':fields.integer('Expected Employees'),
|
||||
'no_of_employee': fields.function(_no_of_employee, method=True, string='No of Employee', type='char'),
|
||||
'no_of_employee': fields.function(_no_of_employee, method=True, string='No of Employee', type='integer'),
|
||||
'employee_ids':fields.one2many('hr.employee', 'job_id','Employees'),
|
||||
'description': fields.text('Job Description'),
|
||||
'requirements':fields.text('Requirements'),
|
||||
'department_id':fields.many2one('hr.department','Department')
|
||||
|
||||
}
|
||||
'department_id':fields.many2one('hr.department','Department'),
|
||||
'company_id': fields.many2one('res.company', 'Company'),
|
||||
'state': fields.selection([('open','Open'),('old','Old'),('recruit','In Recruitement')], 'State', required=True),
|
||||
}
|
||||
_defaults = {
|
||||
'expected_employees': lambda *a: 1,
|
||||
}
|
||||
|
||||
crm_job()
|
||||
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'hr.job', context=c),
|
||||
'state': lambda *args: 'open'
|
||||
}
|
||||
hr_job()
|
||||
|
||||
class hr_employee(osv.osv):
|
||||
_name = "hr.employee"
|
||||
|
@ -115,7 +115,7 @@ class hr_employee(osv.osv):
|
|||
'child_ids': fields.one2many('hr.employee', 'parent_id','Subordinates'),
|
||||
'resource_id': fields.many2one('resource.resource','Resource',ondelete='cascade'),
|
||||
'coach_id':fields.many2one('res.users','Coach'),
|
||||
'job_id':fields.many2one('crm.job', 'Job'),
|
||||
'job_id':fields.many2one('hr.job', 'Job'),
|
||||
|
||||
}
|
||||
_defaults = {
|
||||
|
|
|
@ -62,12 +62,12 @@
|
|||
<field name="work_location"/>
|
||||
</group>
|
||||
|
||||
<group col="4" colspan="2">
|
||||
<separator string="Job Information" colspan="4"/>
|
||||
<field name="parent_id" select="1" colspan="4"/>
|
||||
<field name="coach_id" select="1" colspan="4"/>
|
||||
<!-- <field name="category_id" colspan="4" widget="selection"/>-->
|
||||
<field name="job_id" select="1" colspan="4"/>
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Position" colspan="2"/>
|
||||
<field name="job_id" select="1"/>
|
||||
<separator string="Managers" colspan="2"/>
|
||||
<field name="parent_id" select="1"/>
|
||||
<field name="coach_id" select="1"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Notes">
|
||||
|
@ -94,19 +94,19 @@
|
|||
</field>
|
||||
</record>
|
||||
<record id="view_employee_filter" model="ir.ui.view">
|
||||
<field name="name">Employees</field>
|
||||
<field name="model">hr.employee</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Employees">
|
||||
<group col='6' colspan='2'>
|
||||
<field name="name"/>
|
||||
<field name="parent_id" widget="selection">
|
||||
<field name="name">Employees</field>
|
||||
<field name="model">hr.employee</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Employees">
|
||||
<group col='6' colspan='2'>
|
||||
<field name="name"/>
|
||||
<field name="parent_id" widget="selection">
|
||||
<filter icon="terp-partner" domain="[('parent_id','child_of',uid)]" help="Employees under me"/>
|
||||
</field>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<record id="open_view_employee_tree" model="ir.actions.act_window">
|
||||
<field name="name">Employees Structure</field>
|
||||
|
@ -150,7 +150,7 @@
|
|||
id="menu_open_view_employee_list_my"
|
||||
parent="menu_open_view_employee_list"/>-->
|
||||
<menuitem
|
||||
name="Employees"
|
||||
name="Employees"
|
||||
action="open_view_employee_list_my"
|
||||
id="menu_open_view_employee_list_my"
|
||||
parent="menu_hr_human_resources"/>
|
||||
|
@ -298,77 +298,92 @@
|
|||
|
||||
<menuitem action="open_view_categ_tree" id="menu_view_employee_category_tree" parent="hr.menu_view_employee_category_form"/>
|
||||
|
||||
<record id="view_crm_job_form" model="ir.ui.view">
|
||||
<field name="name">crm.job.form</field>
|
||||
<field name="model">crm.job</field>
|
||||
<record id="view_hr_job_form" model="ir.ui.view">
|
||||
<field name="name">hr.job.form</field>
|
||||
<field name="model">hr.job</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Job">
|
||||
<field name="name" select="1"/>
|
||||
<field name="ref"/>
|
||||
<field name="department_id" select="1"/>
|
||||
<group col="6" colspan="4">
|
||||
<field name="name" select="1"/>
|
||||
<field name="department_id" select="1"/>
|
||||
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
|
||||
<field name="expected_employees"/>
|
||||
<field name="no_of_employee"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<notebook colspan="4">
|
||||
<page string="Description">
|
||||
<separator colspan="4" string="Job Description"/>
|
||||
<field name="description" colspan="4" nolabel="1"/>
|
||||
<separator colspan="4" string="Requirements"/>
|
||||
<field name="requirements" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Employee">
|
||||
<field name="employee_ids" colspan='4' nolabel="1" mode="tree,form"/>
|
||||
<field name="expected_employees"/>
|
||||
<field name="no_of_employee"/>
|
||||
</page>
|
||||
<page string="Description">
|
||||
<field name="description" colspan='4'/>
|
||||
<field name="description"/>
|
||||
</page>
|
||||
</notebook>
|
||||
<field name="employee_ids" colspan='4' nolabel="1" mode="tree,form"/>
|
||||
</page>
|
||||
</notebook>
|
||||
<field name="state"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_crm_job_tree" model="ir.ui.view">
|
||||
<field name="name">crm.job.tree</field>
|
||||
<field name="model">crm.job</field>
|
||||
<record id="view_hr_job_tree" model="ir.ui.view">
|
||||
<field name="name">hr.job.tree</field>
|
||||
<field name="model">hr.job</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Job">
|
||||
<field name="name" select="1"/>
|
||||
<field name="ref"/>
|
||||
<field name="expected_employees"/>
|
||||
<field name="department_id" />
|
||||
<field name="expected_employees"/>
|
||||
<field name="no_of_employee"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_job_filter" model="ir.ui.view">
|
||||
<field name="name">Job</field>
|
||||
<field name="model">crm.job</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Job">
|
||||
<group col='3' colspan='4'>
|
||||
<field name="name"/>
|
||||
<field name="department_id" widget="selection">
|
||||
<filter icon="terp-crm"
|
||||
domain="[('department_id','=',context.get('department_id',False))]"
|
||||
help="My Departments Jobs"/>
|
||||
</field>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
<field name="name">Job</field>
|
||||
<field name="model">hr.job</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Jobs">
|
||||
<filter icon="terp-crm"
|
||||
domain="[('state','in',('open','recruit'))]"
|
||||
string="Current"
|
||||
help="Open and in recruitement positions"/>
|
||||
<filter icon="terp-crm"
|
||||
domain="[('state','=','recruit')]"
|
||||
string="Recruitement"
|
||||
help="In Recruitement"/>
|
||||
<filter icon="terp-crm"
|
||||
domain="[('state','=','open')]"
|
||||
string="Open"
|
||||
help="Open Positions"/>
|
||||
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name"/>
|
||||
<field name="department_id" widget="selection">
|
||||
<filter icon="terp-crm"
|
||||
domain="[('department_id','=',context.get('department_id',False))]"
|
||||
help="My Departments Jobs"/>
|
||||
</field>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.actions.act_window" id="action_crm_job">
|
||||
<field name="name">Job</field>
|
||||
<field name="res_model">crm.job</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_crm_job_tree"/>
|
||||
<field name="search_view_id" ref="view_job_filter"/>
|
||||
</record>
|
||||
<record model="ir.actions.act_window" id="action_hr_job">
|
||||
<field name="name">Job Positions</field>
|
||||
<field name="res_model">hr.job</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
<menuitem icon="terp-hr" id="base.menu_hr" name="Human Resources"/>
|
||||
<menuitem
|
||||
name="Recruitment"
|
||||
id="base.menu_crm_case_job_req_main"
|
||||
parent="base.menu_hr"/>
|
||||
<menuitem icon="terp-hr" id="base.menu_hr" name="Human Resources"/>
|
||||
<menuitem
|
||||
name="Recruitment"
|
||||
id="base.menu_crm_case_job_req_main"
|
||||
parent="base.menu_hr"/>
|
||||
|
||||
<menuitem name="Job" parent="base.menu_crm_case_job_req_main" id="menu_crm_job" action="action_crm_job" sequence="2"/>
|
||||
<menuitem name="Job" parent="base.menu_crm_case_job_req_main" id="menu_hr_job" action="action_hr_job" sequence="2"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
Loading…
Reference in New Issue