[ADD] show no of unread messages in kanban box,improved code to post messge when new applicant created.
bzr revid: tpa@tinyerp.com-20130620054909-dduypa8vdl0y8407
This commit is contained in:
parent
128f012c9b
commit
7f97b9339f
|
@ -95,11 +95,6 @@ class hr_job(osv.osv):
|
|||
_name = "hr.job"
|
||||
_description = "Job Position"
|
||||
_inherit = ['mail.thread','ir.needaction_mixin']
|
||||
_track = {
|
||||
'state': {
|
||||
'hr.mt_job_recruit': lambda self, cr, uid, obj, ctx=None: obj['state'] == 'recruit',
|
||||
},
|
||||
}
|
||||
_columns = {
|
||||
'name': fields.char('Job Name', size=128, required=True, select=True),
|
||||
# TO CLEAN: when doing a cleaning, we should change like this:
|
||||
|
@ -159,6 +154,10 @@ class hr_job(osv.osv):
|
|||
self.write(cr, uid, ids, {'state': 'open', 'no_of_recruitment': 0,'no_of_hired_employee': 0})
|
||||
return True
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
if vals.get('state') == 'recruit':
|
||||
self.message_post(cr, uid, ids, body=_('job in <b>Recruitment</b> Stage'), subtype="hr.mt_job_recruit", context=context)
|
||||
return super(hr_job, self).write(cr, uid, ids, vals, context=context)
|
||||
|
||||
class hr_employee(osv.osv):
|
||||
_name = "hr.employee"
|
||||
|
|
|
@ -24,7 +24,6 @@ Leave Management (keep track of employee leaves), Expense Management (manage emp
|
|||
<record id="mt_job_recruit" model="mail.message.subtype">
|
||||
<field name="name">Recruitment in Progress</field>
|
||||
<field name="res_model">hr.job</field>
|
||||
<field name="description">job in Recruitment Stage</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
|
|
|
@ -402,6 +402,13 @@ class hr_applicant(base_stage, osv.Model):
|
|||
|
||||
return super(hr_applicant, self).message_update(cr, uid, ids, msg, update_vals=update_vals, context=context)
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
obj_id = super(hr_applicant, self).create(cr, uid, vals, context=context)
|
||||
applicant = self.browse(cr, uid, obj_id, context=context)
|
||||
if applicant.job_id:
|
||||
self.pool.get('hr.job').message_post(cr, uid, [applicant.job_id.id], body=_('Applicant <b>created</b>'), subtype="hr_recruitment.mt_job_new_applicant", context=context)
|
||||
return obj_id
|
||||
|
||||
def case_open(self, cr, uid, ids, context=None):
|
||||
"""
|
||||
open Request of the applicant for the hr_recruitment
|
||||
|
|
|
@ -409,6 +409,9 @@
|
|||
<a t-if="record.state.raw_value == 'open'" data-name="job_recruitment" data-type="object" class="oe_kanban_action">Launch Recruitment</a>
|
||||
<a t-if="record.state.raw_value == 'recruit'" data-name="job_open" data-type="object" class="oe_kanban_action">Recruitment Done</a>
|
||||
</div>
|
||||
<div class="oe_kanban_footer_left oe_job_messages">
|
||||
<t t-raw="record.message_summary.raw_value"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
}
|
||||
.openerp .oe_justgage {
|
||||
float: right;
|
||||
margin-top: -60px;
|
||||
margin-top: -55px;
|
||||
margin-right: -30px;
|
||||
width:200px;
|
||||
height:130px;
|
||||
|
@ -81,4 +81,7 @@
|
|||
height: 32px;
|
||||
float: right;
|
||||
padding-right: 88px;
|
||||
}
|
||||
.openerp .oe_job_messages{
|
||||
margin-top: 40px !important;
|
||||
}
|
Loading…
Reference in New Issue