Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3581 Lượt xem

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? 

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 9 22
17756
0
thg 9 15
3540
0
thg 4 15
5412
Libary managment Đã xử lý
2
thg 5 23
1761
1
thg 6 19
5488