123456789101112131415161718192021 |
- # -*- coding: utf-8 -*-
- from openerp.http import request
- def get_current_user():
- user = request.env.user
- return {
- 'id': user.id,
- 'name': user.display_name,
- 'company': {
- 'id': user.company_id.id,
- 'name': user.company_id.display_name,
- 'phone': user.company_id.phone or None,
- 'city': user.company_id.city or None,
- 'street': user.company_id.street or None,
- 'city': user.company_id.city or None,
- 'country': (user.company_id.country_id and user.company_id.country_id.name) or None,
- 'currencyId': user.company_id.currency_id.id or None
- },
- 'isManager': 'Gerente' in user.groups_id.filtered(lambda g: g.category_id.name == 'Eiru POS').mapped(lambda g: g.name)
- }
|