[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>
This commit is contained in:
Pierre Masereel
2019-07-15 08:20:18 +00:00
parent 41e1c3ac57
commit 35b600cd37
+1 -3
View File
@@ -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