usuario.py
725 Bytes
# -*- coding: utf-8 -*-
###############################################################################
#    License, author and contributors information in:                         #
#    __manifest__.py file at the root folder of this module.                  #
###############################################################################
from odoo import models, fields, api, _
from odoo.exceptions import UserError, ValidationError
class res_users(models.Model):
    _inherit = 'res.users'
    def get_turno_activo(self):
        turnos_del_dia = self.env['asw.turno.caja'].search([
            ('turno_usuario', '=', self.id),
            ('turno_estado', '=', 'abierto')
        ])
        return turnos_del_dia