From 0ea31c272c1e01a2f064231ef9ed82e3b3c2dd39 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Fri, 23 Oct 2015 12:02:05 +0200 Subject: [PATCH] [FIX] point_of_sale: exclude rescue sessions when getting current session Rescue sessions have been added with revision bed409322d71935903f6c2e9880bc6462c58b78e With this feature, this is possible to have multiple pos sessions opened for a same user, if there are rescue sessions. `get_current_session` rely on the fact only one pos session can be opened per user. Rescue sessions are now excluded to get the current session, so: - at most one session can be found - rescue sessions cannot be resumed. opw-652857 --- addons/point_of_sale/point_of_sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 81dace6e354..69adc32ccf0 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -42,7 +42,7 @@ class pos_config(osv.osv): result = dict() for record in self.browse(cr, uid, ids, context=context): - session_id = record.session_ids.filtered(lambda r: r.user_id.id == uid and not r.state == 'closed') + session_id = record.session_ids.filtered(lambda r: r.user_id.id == uid and not r.state == 'closed' and not r.rescue) result[record.id] = { 'current_session_id': session_id, 'current_session_state': session_id.state,