-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] portal_backend: Assert all parent menus has internal group
- Loading branch information
1 parent
917fe47
commit c28a8e1
Showing
5 changed files
with
17 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ | |
from . import ir_http | ||
from . import mail_thread | ||
from . import mail_activity_mixin | ||
from . import ir_ui_menu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from odoo import models, Command | ||
|
||
|
||
class IrUiMenu(models.Model): | ||
_inherit = 'ir.ui.menu' | ||
|
||
def load_menus(self, debug): | ||
""" Assert all parent menus has internal group | ||
""" | ||
parent_menus_wo_group = self.search([('parent_id', '=', False), ('groups_id', '=', False)]) | ||
parent_menus_wo_group.write({ | ||
'groups_id': [Command.link(self.env.ref('base.group_user').id)] | ||
}) | ||
return super().load_menus(debug=debug) |
This file was deleted.
Oops, something went wrong.