|
@ -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 |