From 35b600cd37b1204b4e7d9c57e1e69b3ec06d75b5 Mon Sep 17 00:00:00 2001 From: Pierre Masereel Date: Tue, 9 Jul 2019 14:45:44 +0000 Subject: [PATCH] [IMP] point_of_sale: sessions not depending on user As multiple users will be able to login in the main session, we shouldn't use the user_id of a session to find the correct session, but we are only depending on the pos_config closes odoo/odoo#34623 Signed-off-by: pimodoo --- addons/point_of_sale/models/pos_config.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/point_of_sale/models/pos_config.py b/addons/point_of_sale/models/pos_config.py index aab28e82271..8643735b642 100644 --- a/addons/point_of_sale/models/pos_config.py +++ b/addons/point_of_sale/models/pos_config.py @@ -184,9 +184,7 @@ class PosConfig(models.Model): @api.depends('session_ids') def _compute_current_session(self): for pos_config in self: - session = pos_config.session_ids.filtered(lambda r: r.user_id.id == self.env.uid and \ - not r.state == 'closed' and \ - not r.rescue) + session = pos_config.session_ids.filtered(lambda s: s.state != 'closed' and not s.rescue) # sessions ordered by id desc pos_config.current_session_id = session and session[0].id or False pos_config.current_session_state = session and session[0].state or False