跳至內容
選單
此問題已被標幟
3 回覆
570 瀏覽次數

Hi,

Can I know how do we automate the employee creation when the candidate stage is moved to "Contract Hired" in Odoo Recruitment? is this doen through a script?

頭像
捨棄
最佳答案

Hi,


You can add the following code for creating an employee when the recruitment stage is changed to 'Contract Signed'



class HrApplicant(models.Model):
_inherit = 'hr.applicant'

@api.onchange('stage_id')
def onchange_stage(self):
if self.stage_id.hired_stage:
self.create_employee_from_applicant()


Hope it helps

頭像
捨棄
最佳答案

Hello Faisal,
Yes, it is possible to automate employee creation when a candidate reaches the "Contract Signed" stage in Odoo Recruitment. Here's how you can do it:

Odoo's Built-in Functionality

Odoo has a built-in feature to create an employee record directly from the applicant form:

  1. Move the applicant to the "Contract Signed" stage.
  2. Click the "Create Employee" button: Once the applicant is in the "Contract Signed" stage, a "Create Employee" button appears in the top-left corner of the applicant's form.
  3. Fill out the employee form: Clicking this button opens an employee form pre-filled with information from the applicant's card. You'll need to complete any remaining required fields.
  4. Save the employee record: Once completed, the employee record is saved in the Employees app.

Automation via customization

While the "Create Employee" button offers a manual way to do this, you might want to fully automate the process. This typically involves some customization, potentially with a script or Odoo Studio.

  • You could potentially use Odoo Studio (if you have Odoo Enterprise) to create a custom automated action that triggers when the stage changes to "Contract Signed." This action would automatically create the employee record.

For more complex scenarios, you might need a Python script (which would likely require the assistance of an Odoo developer) to achieve the desired level of automation and data transfer.

🚀 Did This Solve Your Problem?

If this answer helped you save time, money, or frustration, consider:

✅ Upvoting (👍) to help others find it faster

✅ Marking as "Best Answer" if it resolved your issue

Your feedback keeps the Odoo community strong! 💪

(Need further customization? Drop a comment—I’m happy to refine the solution!)

頭像
捨棄
最佳答案

You can automatically create an employee record once a job applicant is marked as “Hired” in the Recruitment module.

 Step-by-Step: Enable Automation

  1. Activate Developer Mode
  2. Go to:
    Recruitment > Configuration > Settings
  3. Enable: ✅ Create employee when hired
  4. Now, when you click "Mark as Hired", Odoo will automatically:
    • Convert the applicant into an employee
    • Link their data (name, job position, email) to the new employee record in the HR module

頭像
捨棄