[FIX] point_of_sale: pos is launched with all companies

- Activate multicompany
- In the company switcher select all company
- Launch a pos session
--> Issue all rpc request are make in all companies (len(self.env.companies) != 1). It create some error with taxes, fiscale position, ...

closes odoo/odoo#76522

X-original-commit: a553f86afc5e9ff3ddd58eb6b68ba7ff9cf936a5
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
This commit is contained in:
Florent de Labarre
2021-09-15 09:02:10 +00:00
committed by Pierre Masereel
parent f4c46694f5
commit 522cb20e77
+3 -1
View File
@@ -50,8 +50,10 @@ class PosController(http.Controller):
if not pos_session:
return request.redirect('/web#action=point_of_sale.action_client_pos_menu')
# The POS only work in one company, so we enforce the one of the session in the context
company = pos_session.company_id
session_info = request.env['ir.http'].session_info()
session_info['user_context']['allowed_company_ids'] = pos_session.company_id.ids
session_info['user_context']['allowed_company_ids'] = company.ids
session_info['user_companies'] = {'current_company': company.id, 'allowed_companies': {company.id: session_info['user_companies']['allowed_companies'][company.id]}}
context = {
'session_info': session_info,
'login_number': pos_session.login(),