[FIX] point_of_sale: exclude rescue sessions when getting current session

Rescue sessions have been added with revision
bed409322d

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
This commit is contained in:
Denis Ledoux
2015-10-23 12:07:17 +02:00
parent a9ce4ffb22
commit 0ea31c272c
+1 -1
View File
@@ -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,