From ca0ca65f14bdeeb6813a4526dc82c29393ad9019 Mon Sep 17 00:00:00 2001 From: git_admin Date: Tue, 28 Apr 2026 07:34:54 +0000 Subject: [PATCH] Tower: upload at_accounting 18.0.1.7 (via marketplace) --- addons/at_accounting/models/ir_ui_menu.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 addons/at_accounting/models/ir_ui_menu.py diff --git a/addons/at_accounting/models/ir_ui_menu.py b/addons/at_accounting/models/ir_ui_menu.py new file mode 100644 index 0000000..50a7902 --- /dev/null +++ b/addons/at_accounting/models/ir_ui_menu.py @@ -0,0 +1,21 @@ +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import models + + +class IrUiMenu(models.Model): + _inherit = 'ir.ui.menu' + + def _visible_menu_ids(self, debug=False): + visible_ids = super()._visible_menu_ids(debug) + # These menus should only be visible to accountants (users with group_account_readonly) and the group specified on the menu + # We want to avoid moving these menus to the new `accountant` module + if not self.env.user.has_group('account.group_account_readonly'): + accounting_menus = [ + 'at_accounting.account_tag_menu', + 'at_accounting.menu_account_group', + 'at_accounting.menu_action_account_report_multicurrency_revaluation', + ] + hidden_menu_ids = {self.env.ref(r).sudo().id for r in accounting_menus if self.env.ref(r, raise_if_not_found=False)} + return visible_ids - hidden_menu_ids + return visible_ids