Skip to content

Commit

Permalink
use ensure_one
Browse files Browse the repository at this point in the history
  • Loading branch information
LoisRForgeFlow committed Apr 28, 2017
1 parent 20dd871 commit d155079
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions hr_holiday_notify_employee_manager/models/hr_holidays.py
Expand Up @@ -8,8 +8,10 @@
class HrHolidays(models.Model):
_inherit = 'hr.holidays'

@api.multi
def _get_approvers_to_notify(self):
"""Defines who to notify."""
self.ensure_one()
company = self.employee_id.company_id
if company.leave_notify_manager and self.employee_id.parent_id:
return self.employee_id.parent_id
Expand Down

0 comments on commit d155079

Please sign in to comment.