summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorPierre Masereel <pim@odoo.com>2019-07-09 14:45:44 +0000
committerPierre Masereel <pim@odoo.com>2019-07-15 08:20:18 +0000
commit35b600cd37b1204b4e7d9c57e1e69b3ec06d75b5 (patch)
treeb6160734c3c677bb8fb4dedafa83e239b900d2b2 /addons
parent41e1c3ac57bb64b130f333a507bdc026b7001f2a (diff)
[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 <pimodoo@users.noreply.github.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/point_of_sale/models/pos_config.py4
1 files changed, 1 insertions, 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