[IMP] improved code to add default responsible in applicant if directly created from job and improved view
bzr revid: tpa@tinyerp.com-20131125131705-0j7wu94a2cat480o
This commit is contained in:
@@ -232,6 +232,15 @@ class hr_applicant(osv.Model):
|
||||
'stage_id': _read_group_stage_ids
|
||||
}
|
||||
|
||||
def default_get(self, cr, uid, fields, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
res = super(hr_applicant, self).default_get(cr, uid, fields, context=context)
|
||||
if context.get('active_id'):
|
||||
job = self.pool.get('hr.job').browse(cr, uid, context.get('active_id'), context=context)
|
||||
res.update({'user_id': job.user_id.id})
|
||||
return res
|
||||
|
||||
def onchange_job(self, cr, uid, ids, job_id=False, context=None):
|
||||
if job_id:
|
||||
job_record = self.pool.get('hr.job').browse(cr, uid, job_id, context=context)
|
||||
@@ -486,7 +495,7 @@ class hr_job(osv.osv):
|
||||
'application_count': fields.function(_application_count, type='integer', string="Total Applications"),
|
||||
'manager_id': fields.related('department_id', 'manager_id', type='many2one', string='Department Manager', relation='hr.employee', readonly=True, store=True),
|
||||
'doc_count':fields.function(_get_attached_docs, string="Number of documents attached", type='int'),
|
||||
'user_id': fields.many2one('hr.employee', 'Recruitment Responsible'),
|
||||
'user_id': fields.many2one('res.users', 'Recruitment Responsible'),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
</record>
|
||||
<record id="hr_case_traineemca1" model="hr.applicant">
|
||||
<field name="name">Trainee - MCA</field>
|
||||
<field name="job_id" ref="hr.job_developer"/>
|
||||
<field name="job_id" ref="hr.job_trainee"/>
|
||||
<field name="type_id" ref="degree_bac5"/>
|
||||
<field name="categ_ids" eval="[(6,0,[ref('tag_applicant_sales')])]"/>
|
||||
<field eval="time.strftime('%Y-%m-12 17:49:19')" name="date"/>
|
||||
@@ -96,7 +96,7 @@
|
||||
</record>
|
||||
<record id="hr_case_programmer" model="hr.applicant">
|
||||
<field name="name">Programmer</field>
|
||||
<field name="job_id" ref="hr.job_trainee"/>
|
||||
<field name="job_id" ref="hr.job_developer"/>
|
||||
<field name="type_id" ref="degree_bac5"/>
|
||||
<field name="categ_ids" eval="[(6,0,[ref('tag_applicant_it')])]"/>
|
||||
<field eval="time.strftime('%Y-%m-12 17:49:19')" name="date"/>
|
||||
|
||||
@@ -378,6 +378,7 @@
|
||||
<field name="survey_id"/>
|
||||
<field name="message_summary"/>
|
||||
<field name="state"/>
|
||||
<field name="user_id"/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_job oe_kanban_card oe_kanban_global_click">
|
||||
@@ -405,7 +406,7 @@
|
||||
<field name="name"/>
|
||||
</div>
|
||||
<div class="oe_job oe_department oe_kanban_ellipsis">
|
||||
<field name="user_id"/>
|
||||
<field name="department_id"/>
|
||||
<span t-if="record.manager_id.value" class="oe_manager_name">
|
||||
(<t t-esc="record.manager_id.value"/>)
|
||||
</span>
|
||||
|
||||
Reference in New Issue
Block a user