Browse Source

[FIX] 'web_easy_switch_company' flake8

pull/47/head
Sylvain LE GAL 10 years ago
parent
commit
5b02c32702
  1. 10
      web_easy_switch_company/controllers/main.py

10
web_easy_switch_company/controllers/main.py

@ -25,10 +25,14 @@ from openerp.http import request
class WebEasySwitchCompanyController(http.Controller): class WebEasySwitchCompanyController(http.Controller):
@http.route('/web_easy_switch_company/switch/change_current_company', type='json', auth='none')
@http.route(
'/web_easy_switch_company/switch/change_current_company',
type='json', auth='none')
def change_current_company(self, company_id): def change_current_company(self, company_id):
registry = openerp.modules.registry.RegistryManager.get(request.session.db)
registry = openerp.modules.registry.RegistryManager.get(
request.session.db)
uid = request.session.uid uid = request.session.uid
with registry.cursor() as cr: with registry.cursor() as cr:
res = registry.get("res.users").change_current_company(cr, uid, company_id)
res = registry.get("res.users").change_current_company(
cr, uid, company_id)
return res return res
Loading…
Cancel
Save