diff --git a/res_users_clear_access_rights/README.rst b/res_users_clear_access_rights/README.rst new file mode 100644 index 0000000..c22d661 --- /dev/null +++ b/res_users_clear_access_rights/README.rst @@ -0,0 +1,67 @@ +======================== +Clear User Access rights +======================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:c522ee2ec53e002b0413947d3ddf0cb4b87012877df76710f21e3c34a22fe569 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-it--projects--llc%2Faccess--addons-lightgray.png?logo=github + :target: https://github.com/it-projects-llc/access-addons/tree/14.0/res_users_clear_access_rights + :alt: it-projects-llc/access-addons + +|badge1| |badge2| |badge3| + +There is an inheritance in access right groups. Some time you try untick +something, but after clicking "Save" button you get tick back. In that +case it's better to untick all rights and start access rights +configuration from scratch. This module helps to do it. + +**Table of contents** + +.. contents:: + :local: + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* IT-Projects LLC + +Contributors +------------ + +- Stanislav Krotov (https://github.com/ufaks) +- Ivan Yelizariev (https://github.com/yelizariev) +- Ilya Ilchenko (https://github.com/mentalko) +- Artem Rafailov (https://github.com/Ommo73) +- Eugene Molotov (https://github.com/em230418) + +Maintainers +----------- + +This module is part of the `it-projects-llc/access-addons `_ project on GitHub. + +You are welcome to contribute. diff --git a/res_users_clear_access_rights/__init__.py b/res_users_clear_access_rights/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/res_users_clear_access_rights/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/res_users_clear_access_rights/__manifest__.py b/res_users_clear_access_rights/__manifest__.py new file mode 100644 index 0000000..72171f5 --- /dev/null +++ b/res_users_clear_access_rights/__manifest__.py @@ -0,0 +1,13 @@ +{ + "name": "Clear User Access rights", + "summary": """Useful tool to reset user rights""", + "version": "14.0.1.1.0", + "author": "IT-Projects LLC", + "license": "LGPL-3", + "support": "it@it-projects.info", + "website": "https://github.com/it-projects-llc/access-addons", + "category": "Access", + "images": ["images/clear_user_access_rights.jpg"], + "depends": ["base"], + "data": ["views.xml"], +} diff --git a/res_users_clear_access_rights/doc/changelog.rst b/res_users_clear_access_rights/doc/changelog.rst new file mode 100644 index 0000000..81cb57f --- /dev/null +++ b/res_users_clear_access_rights/doc/changelog.rst @@ -0,0 +1,9 @@ +`1.1.0` +------- + +- **New**: does not clear user type when clear access rights + +`1.0.0` +------- + +- Init version diff --git a/res_users_clear_access_rights/doc/index.rst b/res_users_clear_access_rights/doc/index.rst new file mode 100644 index 0000000..58952d2 --- /dev/null +++ b/res_users_clear_access_rights/doc/index.rst @@ -0,0 +1,8 @@ +========================== + Clear User Access rights +========================== + +Installation +============ + +* `Install `__ this module in a usual way diff --git a/res_users_clear_access_rights/i18n/de.po b/res_users_clear_access_rights/i18n/de.po new file mode 100644 index 0000000..d0a2a72 --- /dev/null +++ b/res_users_clear_access_rights/i18n/de.po @@ -0,0 +1,31 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * res_users_clear_access_rights +# +# Translators: +# Dawid Runowski , 2019 +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-04-26 19:17+0000\n" +"PO-Revision-Date: 2017-12-05 05:26+0000\n" +"Last-Translator: Dawid Runowski , 2019\n" +"Language-Team: German (https://www.transifex.com/it-projects-llc/teams/76080/" +"de/)\n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: res_users_clear_access_rights +#: model:ir.ui.view,arch_db:res_users_clear_access_rights.view_users_form +msgid "Clear access rights" +msgstr "" + +#. module: res_users_clear_access_rights +#: model:ir.model,name:res_users_clear_access_rights.model_res_users +msgid "Users" +msgstr "Benutzer" diff --git a/res_users_clear_access_rights/i18n/es_CR.po b/res_users_clear_access_rights/i18n/es_CR.po new file mode 100644 index 0000000..4545e7c --- /dev/null +++ b/res_users_clear_access_rights/i18n/es_CR.po @@ -0,0 +1,30 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * res_users_clear_access_rights +# +# Translators: +# Randall , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-04-26 19:17+0000\n" +"PO-Revision-Date: 2018-04-26 19:17+0000\n" +"Last-Translator: Randall , 2018\n" +"Language-Team: Spanish (Costa Rica) (https://www.transifex.com/it-projects-" +"llc/teams/76080/es_CR/)\n" +"Language: es_CR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: res_users_clear_access_rights +#: model:ir.ui.view,arch_db:res_users_clear_access_rights.view_users_form +msgid "Clear access rights" +msgstr "Limpiar accesos permitidos" + +#. module: res_users_clear_access_rights +#: model:ir.model,name:res_users_clear_access_rights.model_res_users +msgid "Users" +msgstr "Usuarios" diff --git a/res_users_clear_access_rights/i18n/res_users_clear_access_rights.pot b/res_users_clear_access_rights/i18n/res_users_clear_access_rights.pot new file mode 100644 index 0000000..20a866a --- /dev/null +++ b/res_users_clear_access_rights/i18n/res_users_clear_access_rights.pot @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * res_users_clear_access_rights +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: res_users_clear_access_rights +#: model_terms:ir.ui.view,arch_db:res_users_clear_access_rights.view_users_form +msgid "Clear access rights" +msgstr "" + +#. module: res_users_clear_access_rights +#: model:ir.model,name:res_users_clear_access_rights.model_res_users +msgid "Users" +msgstr "" + diff --git a/res_users_clear_access_rights/images/clear_user_access_rights.jpg b/res_users_clear_access_rights/images/clear_user_access_rights.jpg new file mode 100644 index 0000000..3f88346 Binary files /dev/null and b/res_users_clear_access_rights/images/clear_user_access_rights.jpg differ diff --git a/res_users_clear_access_rights/models.py b/res_users_clear_access_rights/models.py new file mode 100644 index 0000000..ceed1ff --- /dev/null +++ b/res_users_clear_access_rights/models.py @@ -0,0 +1,29 @@ +from odoo import models + + +class ResUsers(models.Model): + _inherit = "res.users" + + def action_clear_access_rights(self): + self.ensure_one() + admin_groups = [ + self.env.ref("base.group_user").id, + self.env.ref("base.group_erp_manager").id, + self.env.ref("base.group_system").id, + ] + + user_types = [ + self.env.ref("base.group_portal").id, + self.env.ref("base.group_public").id, + self.env.ref("base.group_user").id, + ] + + groups_id = [] + for g in self.groups_id: + if self.env.uid == self.id and g.id in admin_groups or g.id in user_types: + # don't allow for Administrator to clear his admin rights + # don't clear user type + continue + groups_id.append((3, g.id)) + self.write({"groups_id": groups_id}) + return True diff --git a/res_users_clear_access_rights/readme/CONTRIBUTORS.md b/res_users_clear_access_rights/readme/CONTRIBUTORS.md new file mode 100644 index 0000000..05b0950 --- /dev/null +++ b/res_users_clear_access_rights/readme/CONTRIBUTORS.md @@ -0,0 +1,5 @@ +- Stanislav Krotov (https://github.com/ufaks) +- Ivan Yelizariev (https://github.com/yelizariev) +- Ilya Ilchenko (https://github.com/mentalko) +- Artem Rafailov (https://github.com/Ommo73) +- Eugene Molotov (https://github.com/em230418) diff --git a/res_users_clear_access_rights/readme/DESCRIPTION.md b/res_users_clear_access_rights/readme/DESCRIPTION.md new file mode 100644 index 0000000..90a52ed --- /dev/null +++ b/res_users_clear_access_rights/readme/DESCRIPTION.md @@ -0,0 +1,4 @@ +There is an inheritance in access right groups. Some time you try untick something, +but after clicking "Save" button you get tick back. +In that case it's better to untick all rights and start access rights configuration from scratch. +This module helps to do it. diff --git a/res_users_clear_access_rights/static/description/after.png b/res_users_clear_access_rights/static/description/after.png new file mode 100644 index 0000000..116916f Binary files /dev/null and b/res_users_clear_access_rights/static/description/after.png differ diff --git a/res_users_clear_access_rights/static/description/before.png b/res_users_clear_access_rights/static/description/before.png new file mode 100644 index 0000000..2013075 Binary files /dev/null and b/res_users_clear_access_rights/static/description/before.png differ diff --git a/res_users_clear_access_rights/static/description/icon.png b/res_users_clear_access_rights/static/description/icon.png new file mode 100644 index 0000000..b43a0a1 Binary files /dev/null and b/res_users_clear_access_rights/static/description/icon.png differ diff --git a/res_users_clear_access_rights/static/description/index.html b/res_users_clear_access_rights/static/description/index.html new file mode 100644 index 0000000..e294da0 --- /dev/null +++ b/res_users_clear_access_rights/static/description/index.html @@ -0,0 +1,47 @@ +
+
+
+

Clear User Access rights

+

Useful tool to reset user rights

+
+ +
+

+ There is an inheritance in access right groups. Some time you try untick something, but after clicking "Save" button you get tick back. In that case it's better to untick all rights and start access rights configuration from scratch. This module helps to do it. +

+
+ +
+
+ +
+

After clearing:

+
+ +
+
+ +
+

+ The only exception is keeping administration rights for current user (i.e. for your user). If you try to do it, access rights "Administration: Settings" and "Humar Resources: Employee" would be still there, while everything else would be removed. +

+
+ +
+
+ +
+
+
+

Need our service?

+

Contact us by email or fill out request form

+ +
+
+
diff --git a/res_users_clear_access_rights/views.xml b/res_users_clear_access_rights/views.xml new file mode 100644 index 0000000..3b1893b --- /dev/null +++ b/res_users_clear_access_rights/views.xml @@ -0,0 +1,20 @@ + + + + res.users.form + res.users + + + + +