[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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user