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
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ env:
matrix:
- LINT_CHECK="1"
- TRANSIFEX="1"
- TESTS="1" ODOO_REPO="odoo/odoo"
- TESTS="1" ODOO_REPO="OCA/OCB"
- UNIT_TEST="1"
- TESTS="1" ODOO_REPO="odoo/odoo" EXCLUDE=database_cleanup
- TESTS="1" ODOO_REPO="OCA/OCB" EXCLUDE=database_cleanup
- TESTS="1" ODOO_REPO="odoo/odoo" INCLUDE=database_cleanup
- TESTS="1" ODOO_REPO="OCA/OCB" INCLUDE=database_cleanup

virtualenv:
system_site_packages: true
Expand Down
3 changes: 2 additions & 1 deletion database_cleanup/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ Usage
=====

After installation of this module, go to the Settings menu -> Technical ->
Database cleanup. Go through the modules, models, columns and tables
Database cleanup. This menu is only available to members of the *Access Rights*
group. Go through the modules, models, columns and tables
entries under this menu (in that order) and find out if there is orphaned data
in your database. You can either delete entries by line, or sweep all entries
in one big step (if you are *really* confident).
Expand Down
8 changes: 4 additions & 4 deletions database_cleanup/models/purge_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def purge(self):
@api.model
def create(self, values):
# make sure the user trying this is actually supposed to do it
if not self.env.ref('database_cleanup.menu_database_cleanup')\
.parent_id._filter_visible_menus():
if self.env.ref(
'base.group_erp_manager') not in self.env.user.groups_id:
raise AccessDenied
return super(CleanupPurgeLine, self).create(values)

Expand Down Expand Up @@ -86,8 +86,8 @@ def name_get(self):
@api.model
def create(self, values):
# make sure the user trying this is actually supposed to do it
if not self.env.ref('database_cleanup.menu_database_cleanup')\
.parent_id._filter_visible_menus():
if self.env.ref(
'base.group_erp_manager') not in self.env.user.groups_id:
raise AccessDenied
return super(PurgeWizard, self).create(values)

Expand Down
1 change: 1 addition & 0 deletions database_cleanup/views/menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<field name="sequence" eval="10" />
<!-- attach to Settings -> Technical -->
<field name="parent_id" ref="base.menu_custom"/>
<field name="groups_id" eval="[(6,0, [ref('base.group_erp_manager')])]"/>
</record>

<record model="ir.ui.menu" id="menu_purge_modules">
Expand Down