Skip to Content
Menu
This question has been flagged
1 Reply
2724 Views

Error says cannot open because have 2 sessions open, but cannot close a session. 

Both sessions show but there is no time next to them.

Avatar
Discard
Best Answer

This is what I did as a workaround, I updated this file odoo/addons/point_of_sale/models/pos_session.py

Look for function below, and change the " > 1" check to " > 2" and update odoo module, then I can open and then close the other session.

@api.constrains('user_id', 'state')
    def _check_unicity(self):
        # open if there is no session in 'opening_control', 'opened', 'closing_control' for one user
        if self.search_count([
                ('state', 'not in', ('closed', 'closing_control')),
                ('user_id', '=', self.user_id.id),
                ('rescue', '=', False)
            ]) > 1:
            raise ValidationError(_("You cannot create two active sessions with the same responsible."))
Avatar
Discard