Odoo Help


Create Job Position Database from other view

Andrias Yohanson
on 10/7/15, 4:40 AM 750 views


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? 

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 10/7/15, 4:40 AM
Seen: 750 times
Last updated: 10/7/15, 4:40 AM