[FIX] web: route /web/session/modules returns a list
Since the changing of assets (8cc066173d)
the /web/session/modules route returned a stringified set instead of a list
After this commit, the route returns a list
closes odoo/odoo#70545
X-original-commit: 54e4a48996826dd8ea16a84517b46a847d6daf3f
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
This commit is contained in:
@@ -1222,7 +1222,7 @@ class Session(http.Controller):
|
||||
@http.route('/web/session/modules', type='json', auth="user")
|
||||
def modules(self):
|
||||
# return all installed modules. Web client is smart enough to not load a module twice
|
||||
return request.env.registry._init_modules | set([module.current_test] if module.current_test else [])
|
||||
return list(request.env.registry._init_modules | set([module.current_test] if module.current_test else []))
|
||||
|
||||
@http.route('/web/session/save_session_action', type='json', auth="user")
|
||||
def save_session_action(self, the_action):
|
||||
|
||||
@@ -56,3 +56,9 @@ class TestSessionInfo(common.HttpCase):
|
||||
result['user_companies'],
|
||||
expected_user_companies,
|
||||
"The session_info['user_companies'] does not have the expected structure")
|
||||
|
||||
def test_session_modules(self):
|
||||
self.authenticate(self.user.login, self.user_password)
|
||||
response = self.url_open("/web/session/modules", data=self.payload, headers=self.headers)
|
||||
data = response.json()
|
||||
self.assertTrue(isinstance(data['result'], list))
|
||||
|
||||
Reference in New Issue
Block a user