Skip to content

Commit

Permalink
improve call to sudo()
Browse files Browse the repository at this point in the history
  • Loading branch information
gurneyalex authored and Jaime Arroyo committed Nov 19, 2019
1 parent edc3464 commit 1cfc21f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hr_holidays_leave_auto_approve/models/hr_leave.py
@@ -1,7 +1,7 @@
# Copyright 2016-2019 Onestein (<http://www.onestein.eu>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import api, models, SUPERUSER_ID
from odoo import api, models


class HrLeave(models.Model):
Expand All @@ -23,7 +23,7 @@ def create(self, values):
).create(values)
if (res.can_approve and res.holiday_status_id.auto_approve) or (
res.holiday_status_id.auto_approve_all):
res.sudo(user=SUPERUSER_ID).action_approve()
res.sudo().action_approve()
return res

@api.model
Expand Down

0 comments on commit 1cfc21f

Please sign in to comment.