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.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
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.
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."))
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up