diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2023-11-15 10:32:25 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2023-11-15 10:32:25 +0700 |
| commit | 132d4b80f3d5dad792468bd14961f6a9540122e2 (patch) | |
| tree | 3fad75ed79dac19785a9a642fb5dae7b255defdf /indoteknik_api/controllers/api_v1 | |
| parent | a1d0f8c14308655b5c1f532927e093569c654216 (diff) | |
add new role for wms and fix bug delete reconcile
Diffstat (limited to 'indoteknik_api/controllers/api_v1')
| -rw-r--r-- | indoteknik_api/controllers/api_v1/user.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/indoteknik_api/controllers/api_v1/user.py b/indoteknik_api/controllers/api_v1/user.py index 7a522d0c..2b297e5d 100644 --- a/indoteknik_api/controllers/api_v1/user.py +++ b/indoteknik_api/controllers/api_v1/user.py @@ -42,9 +42,17 @@ class User(controller.Controller): uid = request.session.authenticate( config.get('db_name'), email, password) user = request.env['res.users'].browse(uid) + role = [] + if user.is_inbound and user.is_outbound: + role.append('admin') + elif user.is_outbound: + role.append('outbound') + elif user.is_inbound: + role.append('inbound') data = { 'is_auth': True, - 'user': self.response_with_token(user) + 'role': role, + 'user': self.response_with_token(user), } return self.response(data) except: |
