Odoo Help


How to create a job position in python ??

on 7/22/15, 4:20 AM 1,054 views

I used the following code to create job position but I was unsuccessful because of the mail.alias object that it is inherited it

job = {'name':'System Engineer'} 

job = self.pool.get('hr.job').create(cr, uid, job, context=context)

Any help


Solanki Shamji

--Solanki Shamji--

| 5 2 7
Baroda, India
--Solanki Shamji--


Solanki Shamji
On 7/22/15, 5:00 AM

May be this will helpful to you.

    def create(self, cr, uid, vals, context=None):
alias_context = dict(context, alias_model_name='hr.applicant', alias_parent_model_name=self._name)
job_id = super(hr_job, self).create(cr, uid, vals, context=alias_context)
job = self.browse(cr, uid, job_id, context=context)
self.pool.get('mail.alias').write(cr, uid, [job.alias_id.id], {'alias_parent_thread_id': job_id, "alias_defaults": {'job_id': job_id}}, context)
return job_id

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: 7/22/15, 4:20 AM
Seen: 1054 times
Last updated: 7/22/15, 5:00 AM