From 7ba598c8ac2a707e93134e97f34b8668a530fd17 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Thu, 16 Nov 2023 16:35:11 +0700 Subject: modification api users for wms --- indoteknik_api/controllers/api_v1/user.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'indoteknik_api/controllers/api_v1/user.py') diff --git a/indoteknik_api/controllers/api_v1/user.py b/indoteknik_api/controllers/api_v1/user.py index 2b297e5d..2848f347 100644 --- a/indoteknik_api/controllers/api_v1/user.py +++ b/indoteknik_api/controllers/api_v1/user.py @@ -42,13 +42,14 @@ class User(controller.Controller): uid = request.session.authenticate( config.get('db_name'), email, password) user = request.env['res.users'].browse(uid) - role = [] + role = '' + if user.is_inbound and user.is_outbound: - role.append('admin') + role = 'admin' elif user.is_outbound: - role.append('outbound') + role = 'outbound' elif user.is_inbound: - role.append('inbound') + role = 'inbound' data = { 'is_auth': True, 'role': role, -- cgit v1.2.3