Skip to content

Commit

Permalink
Update code according to comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
feketemihai authored and leemannd committed Jun 12, 2017
1 parent 49b1510 commit 5170e0d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions hr_holidays_legal_leave/models/hr_holidays_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,10 @@ def _get_default_company(self):
@api.depends('company_id')
def _compute_is_annual(self):
for rec in self:
legal_holiday = rec.company_id.legal_holidays_status_id
rec.is_annual = legal_holiday.id == rec.id
rec.is_annual = rec.company_id.legal_holidays_status_id == rec

@api.multi
def _inverse_is_annual(self):
for rec in self:
if not rec.company_id:
rec.company_id = self.env.user.company_id.id
if rec.is_annual:
if rec.is_annual and rec.company_id:
rec.company_id.legal_holidays_status_id = rec.id

0 comments on commit 5170e0d

Please sign in to comment.