Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions access_apps/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ Adds **Apps access** selection in user's access rights tab. Two options are avai
* *Allow installing apps*
* *Allow installing apps only from settings*

Roadmap
=======

* Access records (e.g. ``access_ir_module_module_group_user``) should not be deleted. It has to be disactivated and make active on uninstallation

Questions?
==========

Expand Down
1 change: 1 addition & 0 deletions access_apps/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from . import models
from .hooks import uninstall_hook
6 changes: 3 additions & 3 deletions access_apps/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# Copyright 2018,2021 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# Copyright 2018 Ildar Nasyrov <https://it-projects.info/team/iledarn>
# License MIT (https://opensource.org/licenses/MIT).
{
Expand All @@ -7,7 +7,7 @@
"category": "Access",
# "live_test_url": "",
"images": [],
"version": "14.0.1.3.3",
"version": "14.0.2.0.0",
"application": False,
"author": "IT-Projects LLC, Ivan Yelizariev",
"support": "apps@itpp.dev",
Expand All @@ -23,7 +23,7 @@
"post_load": None,
"pre_init_hook": None,
"post_init_hook": None,
"uninstall_hook": None,
"uninstall_hook": "uninstall_hook",
"auto_install": False,
"installable": True,
}
5 changes: 5 additions & 0 deletions access_apps/doc/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
`2.0.0`
-------
- **Fix:** restore original access rights on uninstallation
- **Fix:** error in Settings menu when some modules are installed

`1.3.3`
-------
- **Fix:** Grant `Allow installing apps` to Admin and System users (it was only System)
Expand Down
11 changes: 11 additions & 0 deletions access_apps/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright 2021 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# License MIT (https://opensource.org/licenses/MIT).
from odoo import SUPERUSER_ID, api


def uninstall_hook(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
access = env.ref(
"base.access_ir_module_module_group_user", raise_if_not_found=False
)
access.write({"active": True})
2 changes: 1 addition & 1 deletion access_apps/models/res_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def default_get(self, fields):
for name, module in classified["to_uninstall"]:
res[name] = module.state in ("installed", "to install", "to upgrade")
if self._fields[name].type == "selection":
res[name] = int(res[name])
res[name] = str(int(res[name]))

return res

Expand Down
8 changes: 7 additions & 1 deletion access_apps/security/access_apps_security.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2018,2021 Ivan Yelizariev <https://twitter.com/yelizariev>
Copyright 2018 Ildar Nasyrov <https://it-projects.info/team/iledarn>
License MIT (https://opensource.org/licenses/MIT).
-->
<odoo>
<delete id="base.access_ir_module_module_group_user" model="ir.model.access" />
<record id="base.access_ir_module_module_group_user" model="ir.model.access">
<field name="active" eval="False" />
</record>
<record id="module_category_access_apps" model="ir.module.category">
<field name="name">Apps access</field>
<field name="sequence">18</field>
Expand Down