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
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
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
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
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up