Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Discuss

Entity: res.users

Compute Method: _compute_is_out_of_office

Inputs Method Outputs
""" Out-of-office is considered as activated once out_of_office_from is
        set in the past. "To" is not mandatory, as users could simply deactivate
        it when coming back if the leave timerange is unknown. """
now = self.env.cr.now()
todo = self.filtered(lambda u: u.out_of_office_from and u._is_internal())
for user in todo:
            if user.out_of_office_to:
                user.is_out_of_office = (user.out_of_office_from <= now <= user.out_of_office_to)
            else:
                user.is_out_of_office = (user.out_of_office_from <= now)
(self - todo).is_out_of_office = False

Back to entity