[MIG]hide_portal_module_by_user:add ticket portal group

This commit is contained in:
2026-03-24 11:47:43 +01:00
parent 84284e6c68
commit 76d0085c2d
2 changed files with 19 additions and 14 deletions

View File

@@ -5,7 +5,7 @@ from odoo.http import request
from odoo.addons.portal.controllers.portal import CustomerPortal from odoo.addons.portal.controllers.portal import CustomerPortal
from werkzeug.exceptions import NotFound from werkzeug.exceptions import NotFound
WHITELISTED_ROUTES = ['/my/home', '/my', '/my/account', '/my/security', '/my/payment_method'] WHITELISTED_ROUTES = ['/my/invoices','/my/home', '/my', '/my/account', '/my/security', '/my/payment_method']
class CustomerPortalPolicy(CustomerPortal): class CustomerPortalPolicy(CustomerPortal):

View File

@@ -32,7 +32,12 @@ class IrUiView(models.Model):
view_xml = etree.fromstring(self.arch) view_xml = etree.fromstring(self.arch)
groups_from_view = {} groups_from_view = {}
for option in view_xml.xpath("//t[@t-call='portal.portal_docs_entry']"): xpath_expressions = [
"//t[@t-call='portal.portal_docs_entry']",
"//t[@t-call='helpdesk_mgmt.portal_docs_entry']",
]
for xpath_expr in xpath_expressions:
for option in view_xml.xpath(xpath_expr):
has_title = option.find("t[@t-set='title']") has_title = option.find("t[@t-set='title']")
if has_title is not None: if has_title is not None:
title = has_title.text title = has_title.text