Hello,
I Need to create Job Position in Recruitment Module base on Job Order (Jo) Module that i create, here are the jo.py
class jo(osv.osv):
_name = 'jo.jo'
_columns = {
'name' : fields.char('Jo Number', size=100, required=True),
'jo_job_postion_id' : fields.many2one('job.position.ref', string='Job Position'),
}
def create_job_id(self, cr, uid, ids, context=None):
jo = self.browse(cr, uid, ids, context=context)
if jo.jo_job_postion_id:
create_ctx = dict(context, mail_broadcast=True)
job_id = hr_job.create(cr, uid, {'name': jo.jo_job_postion_id,
'jo_id': jo.id,
}, context=create_ctx)
self.write(cr, uid, [applicant.id], {'job_id': job_id}, context=context)
class hr_job(osv.osv):
_inherit = 'hr.job'
_columns = {
jo_id' : fields.many2one('jo.jo', 'No Jo', readonly=True),
}
class job_position_ref(osv.osv):
_name = 'job.position.ref'
_columns = {
'name' : fields.char('Job Position Type', size=100, required=True),
}
And The xml view add a button to launc the action
<field name="jo_job_postion_id" class="oe_inline" attrs="{'readonly': [('state', 'in', ['confirmed', 'approve'])] }"/>
<button string="Launch Recruitment" name="create_job_id" type="object" class="oe_link oe_inline" style="margin-left: 8px;"/>
I cannot create job position database, and trying something but no result. Can some one help me to do this properly?