diff --git a/login_as_any_user/README.rst b/login_as_any_user/README.rst new file mode 100644 index 000000000..0a2953680 --- /dev/null +++ b/login_as_any_user/README.rst @@ -0,0 +1,50 @@ +.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg + :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + + +Login As any User +================= +The Login As Any User module in Odoo 16 enables administrators to log in as any +user in the system. With this module, you can test user access and permissions, +troubleshoot issues, or view the system as a specific user. + +Installation +============ + - www.odoo.com/documentation/15.0/setup/install.html + - Install our custom addon + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developers: (V15) Nihala KP @cybrosys + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +-------- +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com + +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com" + + +Further information +=================== +HTML Description: ``__ diff --git a/login_as_any_user/__init__.py b/login_as_any_user/__init__.py new file mode 100644 index 000000000..8bdabdbc5 --- /dev/null +++ b/login_as_any_user/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Nihala KP () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import controllers +from . import models +from . import session diff --git a/login_as_any_user/__manifest__.py b/login_as_any_user/__manifest__.py new file mode 100644 index 000000000..6bb68909a --- /dev/null +++ b/login_as_any_user/__manifest__.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Nihala KP () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': 'Login As Any User', + 'version': '15.0.1.0.0', + 'category': 'Extra Tools', + 'summary': 'Admin can log in as any user', + 'description': 'The "Login As Any User" module allows administrators to ' + 'switch to any user account without the need for ' + 'passwords or other authentication.', + 'author': 'Cybrosys Techno Solution', + 'maintainer': 'Cybrosys Techno Solution', + 'company': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['base'], + 'data': [ + 'security/ir.model.access.csv', + 'views/user_selection_views.xml' + ], + 'assets': { + 'web.assets_backend': { + 'login_as_any_user/static/src/js/systray_button.js', + }, + 'web.assets_qweb': { + 'login_as_any_user/static/src/xml/systray_button_templates.xml', + }, + }, + 'images': [ + 'static/description/banner.jpg', + 'static/description/icon.png', + ], + 'license': 'LGPL-3', + 'installable': True, + 'auto-install': False, + 'application': False, +} diff --git a/login_as_any_user/controllers/__init__.py b/login_as_any_user/controllers/__init__.py new file mode 100644 index 000000000..a6e2c834a --- /dev/null +++ b/login_as_any_user/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Nihala KP () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import user_switch diff --git a/login_as_any_user/controllers/user_switch.py b/login_as_any_user/controllers/user_switch.py new file mode 100644 index 000000000..41ebeff27 --- /dev/null +++ b/login_as_any_user/controllers/user_switch.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Nihala KP () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import http +from odoo.http import request + + +class UserSwitch(http.Controller): + """This is a controller to switch user and switch back to admin + user_switch: + this function is to check weather the user is admin or not + switch_admin: + function to switch back to admin + """ + @http.route('/switch/admin', type='json', auth='public') + def switch_admin(self): + """ + Summary: + Function to move back to admin + Return: + The home page to be loaded + """ + session = request.session + pre_user = request.env['res.users'].browse(session.previous_user) + if pre_user and pre_user._is_admin: + session.authenticate_without_password(request.env.cr.dbname, + pre_user.login, request.env) + return { + 'type': 'ir.actions.act_url', + 'url': '/', + 'target': 'self' + } + return True diff --git a/login_as_any_user/doc/RELEASE_NOTES.md b/login_as_any_user/doc/RELEASE_NOTES.md new file mode 100755 index 000000000..9604ef93e --- /dev/null +++ b/login_as_any_user/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 08.07.2024 +#### Version 15.0.1.0.0 +#### ADD + +- Initial Commit for Login As Any User \ No newline at end of file diff --git a/login_as_any_user/models/__init__.py b/login_as_any_user/models/__init__.py new file mode 100644 index 000000000..414db1389 --- /dev/null +++ b/login_as_any_user/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Nihala KP () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import res_groups +from . import user_selection diff --git a/login_as_any_user/models/res_groups.py b/login_as_any_user/models/res_groups.py new file mode 100644 index 000000000..7717a18b5 --- /dev/null +++ b/login_as_any_user/models/res_groups.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Nihala KP () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class ResGroups(models.Model): + """Class to inherit a new field to res groups""" + _inherit = 'res.groups' + + user_id = fields.Many2one('user.selection', string="User", + help="Get the details of user in res groups") diff --git a/login_as_any_user/models/user_selection.py b/login_as_any_user/models/user_selection.py new file mode 100644 index 000000000..31396e626 --- /dev/null +++ b/login_as_any_user/models/user_selection.py @@ -0,0 +1,73 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Nihala KP () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import api, fields, models +from odoo.http import request + + +class UserSelection(models.Model): + """ + Class for a wizard for users selection + _onchange_user_id: + function to get corresponding user group + action_switch: + function for switching the user + """ + _name = 'user.selection' + _description = 'user selection' + _rec_name = 'user_id' + + user_id = fields.Many2one('res.users', string="User", required=True, + help="Select the user here to switch the user", + domain=lambda self: [ + ('id', '!=', self.env.user.id)]) + access_ids = fields.One2many('res.groups', 'user_id', + help="Get the details of user groups in this " + "model", + string="Group", readonly=True) + + @api.onchange('user_id') + def _onchange_user_id(self): + """ + Summary: + change function to get users access group + """ + self.access_ids = self.user_id.groups_id + + def action_switch(self): + """ + Summary: + function for switching the user + Return: + Main login page after logged in + """ + self.ensure_one() + session = request.session + session.update({ + 'previous_user': self.env.user.id, + }) + session.authenticate_without_password(self.env.cr.dbname, + self.user_id.login, self.env) + return { + 'type': 'ir.actions.act_url', + 'url': '/', + 'target': 'self' + } diff --git a/login_as_any_user/security/ir.model.access.csv b/login_as_any_user/security/ir.model.access.csv new file mode 100644 index 000000000..16a9c477c --- /dev/null +++ b/login_as_any_user/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_user_selection_user,access.user.selection.user,model_user_selection,base.group_user,1,1,1,1 diff --git a/login_as_any_user/session.py b/login_as_any_user/session.py new file mode 100644 index 000000000..27f418440 --- /dev/null +++ b/login_as_any_user/session.py @@ -0,0 +1,43 @@ +"""this python function is to log in as any user without password authentication""" +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Nihala KP () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +import odoo +from odoo.modules.registry import Registry +from odoo.tools._vendor import sessions + + +def authenticate_without_password(self, dbname, login, env): + """function for login without password""" + registry = Registry(dbname) + pre_uid = env['res.users'].search([("login", '=', login)]).id + self.uid = None + self.pre_login = login + self.pre_uid = pre_uid + with registry.cursor() as cr: + env = odoo.api.Environment(cr, pre_uid, {}) + user = env['res.users'].browse(pre_uid) + if not user._mfa_url(): + self.finalize() + return pre_uid + + +sessions.Session.authenticate_without_password = authenticate_without_password diff --git a/login_as_any_user/static/description/assets/icons/check.png b/login_as_any_user/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/login_as_any_user/static/description/assets/icons/check.png differ diff --git a/login_as_any_user/static/description/assets/icons/chevron.png b/login_as_any_user/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/login_as_any_user/static/description/assets/icons/chevron.png differ diff --git a/login_as_any_user/static/description/assets/icons/cogs.png b/login_as_any_user/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/login_as_any_user/static/description/assets/icons/cogs.png differ diff --git a/login_as_any_user/static/description/assets/icons/consultation.png b/login_as_any_user/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/login_as_any_user/static/description/assets/icons/consultation.png differ diff --git a/login_as_any_user/static/description/assets/icons/ecom-black.png b/login_as_any_user/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/login_as_any_user/static/description/assets/icons/ecom-black.png differ diff --git a/login_as_any_user/static/description/assets/icons/education-black.png b/login_as_any_user/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/login_as_any_user/static/description/assets/icons/education-black.png differ diff --git a/login_as_any_user/static/description/assets/icons/hotel-black.png b/login_as_any_user/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/login_as_any_user/static/description/assets/icons/hotel-black.png differ diff --git a/login_as_any_user/static/description/assets/icons/license.png b/login_as_any_user/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/login_as_any_user/static/description/assets/icons/license.png differ diff --git a/login_as_any_user/static/description/assets/icons/lifebuoy.png b/login_as_any_user/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/login_as_any_user/static/description/assets/icons/lifebuoy.png differ diff --git a/login_as_any_user/static/description/assets/icons/manufacturing-black.png b/login_as_any_user/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/login_as_any_user/static/description/assets/icons/manufacturing-black.png differ diff --git a/login_as_any_user/static/description/assets/icons/pos-black.png b/login_as_any_user/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/login_as_any_user/static/description/assets/icons/pos-black.png differ diff --git a/login_as_any_user/static/description/assets/icons/puzzle.png b/login_as_any_user/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/login_as_any_user/static/description/assets/icons/puzzle.png differ diff --git a/login_as_any_user/static/description/assets/icons/restaurant-black.png b/login_as_any_user/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/login_as_any_user/static/description/assets/icons/restaurant-black.png differ diff --git a/login_as_any_user/static/description/assets/icons/service-black.png b/login_as_any_user/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/login_as_any_user/static/description/assets/icons/service-black.png differ diff --git a/login_as_any_user/static/description/assets/icons/trading-black.png b/login_as_any_user/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/login_as_any_user/static/description/assets/icons/trading-black.png differ diff --git a/login_as_any_user/static/description/assets/icons/training.png b/login_as_any_user/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/login_as_any_user/static/description/assets/icons/training.png differ diff --git a/login_as_any_user/static/description/assets/icons/update.png b/login_as_any_user/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/login_as_any_user/static/description/assets/icons/update.png differ diff --git a/login_as_any_user/static/description/assets/icons/user.png b/login_as_any_user/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/login_as_any_user/static/description/assets/icons/user.png differ diff --git a/login_as_any_user/static/description/assets/icons/wrench.png b/login_as_any_user/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/login_as_any_user/static/description/assets/icons/wrench.png differ diff --git a/login_as_any_user/static/description/assets/misc/categories.png b/login_as_any_user/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/login_as_any_user/static/description/assets/misc/categories.png differ diff --git a/login_as_any_user/static/description/assets/misc/check-box.png b/login_as_any_user/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/login_as_any_user/static/description/assets/misc/check-box.png differ diff --git a/login_as_any_user/static/description/assets/misc/compass.png b/login_as_any_user/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/login_as_any_user/static/description/assets/misc/compass.png differ diff --git a/login_as_any_user/static/description/assets/misc/corporate.png b/login_as_any_user/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/login_as_any_user/static/description/assets/misc/corporate.png differ diff --git a/login_as_any_user/static/description/assets/misc/customer-support.png b/login_as_any_user/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/login_as_any_user/static/description/assets/misc/customer-support.png differ diff --git a/login_as_any_user/static/description/assets/misc/cybrosys-logo.png b/login_as_any_user/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/login_as_any_user/static/description/assets/misc/cybrosys-logo.png differ diff --git a/login_as_any_user/static/description/assets/misc/features.png b/login_as_any_user/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/login_as_any_user/static/description/assets/misc/features.png differ diff --git a/login_as_any_user/static/description/assets/misc/logo.png b/login_as_any_user/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/login_as_any_user/static/description/assets/misc/logo.png differ diff --git a/login_as_any_user/static/description/assets/misc/pictures.png b/login_as_any_user/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/login_as_any_user/static/description/assets/misc/pictures.png differ diff --git a/login_as_any_user/static/description/assets/misc/pie-chart.png b/login_as_any_user/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/login_as_any_user/static/description/assets/misc/pie-chart.png differ diff --git a/login_as_any_user/static/description/assets/misc/right-arrow.png b/login_as_any_user/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/login_as_any_user/static/description/assets/misc/right-arrow.png differ diff --git a/login_as_any_user/static/description/assets/misc/star.png b/login_as_any_user/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/login_as_any_user/static/description/assets/misc/star.png differ diff --git a/login_as_any_user/static/description/assets/misc/support.png b/login_as_any_user/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/login_as_any_user/static/description/assets/misc/support.png differ diff --git a/login_as_any_user/static/description/assets/misc/whatsapp.png b/login_as_any_user/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/login_as_any_user/static/description/assets/misc/whatsapp.png differ diff --git a/login_as_any_user/static/description/assets/modules/auto_database_backup.gif b/login_as_any_user/static/description/assets/modules/auto_database_backup.gif new file mode 100644 index 000000000..591c8b18d Binary files /dev/null and b/login_as_any_user/static/description/assets/modules/auto_database_backup.gif differ diff --git a/login_as_any_user/static/description/assets/modules/hide_menu_user.png b/login_as_any_user/static/description/assets/modules/hide_menu_user.png new file mode 100644 index 000000000..6bc155887 Binary files /dev/null and b/login_as_any_user/static/description/assets/modules/hide_menu_user.png differ diff --git a/login_as_any_user/static/description/assets/modules/multi_branch_base.png b/login_as_any_user/static/description/assets/modules/multi_branch_base.png new file mode 100644 index 000000000..6f654cfdb Binary files /dev/null and b/login_as_any_user/static/description/assets/modules/multi_branch_base.png differ diff --git a/login_as_any_user/static/description/assets/modules/odoo_dynamic_dashboard.png b/login_as_any_user/static/description/assets/modules/odoo_dynamic_dashboard.png new file mode 100644 index 000000000..3599974eb Binary files /dev/null and b/login_as_any_user/static/description/assets/modules/odoo_dynamic_dashboard.png differ diff --git a/login_as_any_user/static/description/assets/modules/odoo_website_helpdesk.png b/login_as_any_user/static/description/assets/modules/odoo_website_helpdesk.png new file mode 100644 index 000000000..f19f3578e Binary files /dev/null and b/login_as_any_user/static/description/assets/modules/odoo_website_helpdesk.png differ diff --git a/login_as_any_user/static/description/assets/modules/web_login_styles.png b/login_as_any_user/static/description/assets/modules/web_login_styles.png new file mode 100644 index 000000000..e20126a45 Binary files /dev/null and b/login_as_any_user/static/description/assets/modules/web_login_styles.png differ diff --git a/login_as_any_user/static/description/assets/screenshots/1.png b/login_as_any_user/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..24da3ca1b Binary files /dev/null and b/login_as_any_user/static/description/assets/screenshots/1.png differ diff --git a/login_as_any_user/static/description/assets/screenshots/2.png b/login_as_any_user/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..8aca3c266 Binary files /dev/null and b/login_as_any_user/static/description/assets/screenshots/2.png differ diff --git a/login_as_any_user/static/description/assets/screenshots/3.png b/login_as_any_user/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..d1482e6f8 Binary files /dev/null and b/login_as_any_user/static/description/assets/screenshots/3.png differ diff --git a/login_as_any_user/static/description/assets/screenshots/4.png b/login_as_any_user/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..6e14df425 Binary files /dev/null and b/login_as_any_user/static/description/assets/screenshots/4.png differ diff --git a/login_as_any_user/static/description/assets/screenshots/v15-hero .gif b/login_as_any_user/static/description/assets/screenshots/v15-hero .gif new file mode 100644 index 000000000..727eeae48 Binary files /dev/null and b/login_as_any_user/static/description/assets/screenshots/v15-hero .gif differ diff --git a/login_as_any_user/static/description/banner.jpg b/login_as_any_user/static/description/banner.jpg new file mode 100644 index 000000000..db2fd9de2 Binary files /dev/null and b/login_as_any_user/static/description/banner.jpg differ diff --git a/login_as_any_user/static/description/icon.png b/login_as_any_user/static/description/icon.png new file mode 100644 index 000000000..4e8ad7a29 Binary files /dev/null and b/login_as_any_user/static/description/icon.png differ diff --git a/login_as_any_user/static/description/index.html b/login_as_any_user/static/description/index.html new file mode 100644 index 000000000..094681bd7 --- /dev/null +++ b/login_as_any_user/static/description/index.html @@ -0,0 +1,643 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+ +

+ Login As Any User

+

+ Now You Can Log In As Any User In Odoo15

+ + +
+
+
+ + +
+ + +
+
+ +
+

+ Explore This + Module

+
+ + + + +
+
+ +
+

+ Overview +

+
+
+
+ This module allow you to log in as any user in your Odoo System +
+
+ + + +
+
+ +
+

+ Features +

+
+
+
+
+ + Allows you to test the Odoo system from the perspective of different users. +
+
+ + + Helps to troubleshoot problems other users facing. +
+
+ + Switch to another user without password and username which can only be done by admins. + +
+
+ + Available in Odoo 15 community and enterprise. + +
+
+
+ + + +
+
+ +
+

+ Screenshots +

+
+
+
+
+

+ After installing the module, able to view a new user icon in the systray +

+ +
+
+

+ Clicking the user icon will open a User selection wizard

+ +
+
+

+ Select a User and click "SWITCH USER" button

+ +
+ + +
+

+ You will be logged in as the selected user +

+

*only admins can log in as another user.

+ +
+
+
+ + + +
+
+ +
+

+ Related + Products +

+
+
+
+ +
+
+ + + + +
+
+ +
+

+ Our Services +

+
+ +
+
+
+
+ +
+
+ Odoo + Customization
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Support
+
+ + +
+
+ +
+
+ Hire + Odoo + Developer
+
+ +
+
+ +
+
+ Odoo + Integration
+
+ +
+
+ +
+
+ Odoo + Migration
+
+ + +
+
+ +
+
+ Odoo + Consultancy
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Licensing Consultancy
+
+
+ +
+ + + + + +
+
+ +
+

+ Our + Industries +

+
+ +
+
+
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+ +
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+ +
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+ +
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

+
+
+ +
+
+ +
+ E-commerce & Website +
+

+ Mobile + friendly, + awe-inspiring product pages

+
+
+ +
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice

+
+
+ +
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

+
+
+ +
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application

+
+
+
+
+ + + + +
+
+ +
+

+ Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

Got questions or need help? + Get in touch.

+ +

+ odoo@cybrosys.com

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on WhatsApp!

+ +

+ +91 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+ diff --git a/login_as_any_user/static/src/js/systray_button.js b/login_as_any_user/static/src/js/systray_button.js new file mode 100644 index 000000000..646330521 --- /dev/null +++ b/login_as_any_user/static/src/js/systray_button.js @@ -0,0 +1,40 @@ +/** @odoo-module**/ +import SystrayMenu from 'web.SystrayMenu'; +import Widget from 'web.Widget'; +var session = require('web.session'); +var rpc = require('web.rpc'); +var ajax = require('web.ajax'); +/** + * We define this module for the function of wizard button + * + */ +var UserSwitchWidget = Widget.extend({ + template: 'UserSwitchSystray', + events: { + 'click #switch_user': '_onClick', + }, + /** + * Click function for opening wizard and returning back to the user + */ + _onClick: function() { + var self=this + if (session.is_admin == true) { + self.do_action({ + type: 'ir.actions.act_window', + name: 'Switch User', + res_model: 'user.selection', + view_mode: 'form', + views: [ + [false, 'form'] + ], + target: 'new' + }) + }else{ + ajax.jsonRpc('/switch/admin', 'call', {}).then(function(){ + location.reload(); + }) + } + } +}) +SystrayMenu.Items.push(UserSwitchWidget) +export default UserSwitchWidget diff --git a/login_as_any_user/static/src/xml/systray_button_templates.xml b/login_as_any_user/static/src/xml/systray_button_templates.xml new file mode 100644 index 000000000..1ab3edcb6 --- /dev/null +++ b/login_as_any_user/static/src/xml/systray_button_templates.xml @@ -0,0 +1,16 @@ + + + + +
+ +
+
+
diff --git a/login_as_any_user/views/user_selection_views.xml b/login_as_any_user/views/user_selection_views.xml new file mode 100644 index 000000000..71c7f09fb --- /dev/null +++ b/login_as_any_user/views/user_selection_views.xml @@ -0,0 +1,22 @@ + + + + + user.selection.view.form + user.selection + +
+ + + + + + +
+
+