Odoo Help

Welcome!

This community 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.

0

Create Job Position Database from other view [Closed]

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

The Question has been closed for reason: duplicate question

by
Temur
on 10/07/2015 05:47:11

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? 

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 10/7/15, 4:40 AM
Seen: 186 times
Last updated: 10/7/15, 5:47 AM