Skip to content

Commit

Permalink
[FIX] hr_employee_calendar_planning: Add ondelete to employee_id and …
Browse files Browse the repository at this point in the history
…calendar_id fields to allow removal

TT44093
  • Loading branch information
victoralmau committed Jul 5, 2023
1 parent 70d10f7 commit 33b0bdb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions hr_employee_calendar_planning/models/hr_employee.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,16 +188,15 @@ class HrEmployeeCalendar(models.Model):
string="End Date",
)
employee_id = fields.Many2one(
comodel_name="hr.employee",
string="Employee",
required=True,
comodel_name="hr.employee", string="Employee", required=True, ondelete="cascade"
)
company_id = fields.Many2one(related="employee_id.company_id")
calendar_id = fields.Many2one(
comodel_name="resource.calendar",
string="Working Time",
required=True,
check_company=True,
ondelete="restrict",
)

_sql_constraints = [
Expand Down

0 comments on commit 33b0bdb

Please sign in to comment.