From 8935e935ea425b4934b92f0e1637578cbeb799d0 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Mon, 22 Jul 2024 17:49:45 +0200 Subject: [PATCH] [FIX] account_financial_risk: Sudo on ir.model.data search Only superadmins have access to this model, so let's do the operation with sudo for getting the ID, which is the only intention of that code. TT50264 --- account_financial_risk/__manifest__.py | 2 +- account_financial_risk/models/res_partner.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/account_financial_risk/__manifest__.py b/account_financial_risk/__manifest__.py index 055911bf0..c284b7fd0 100644 --- a/account_financial_risk/__manifest__.py +++ b/account_financial_risk/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Account Financial Risk", "summary": "Manage customer risk", - "version": "17.0.1.0.0", + "version": "17.0.1.0.1", "category": "Accounting", "license": "AGPL-3", "author": "Tecnativa, Odoo Community Association (OCA)", diff --git a/account_financial_risk/models/res_partner.py b/account_financial_risk/models/res_partner.py index 293e2c1b1..fbfc812cf 100644 --- a/account_financial_risk/models/res_partner.py +++ b/account_financial_risk/models/res_partner.py @@ -536,6 +536,7 @@ def open_risk_pivot_info(self): view_name = "financial_risk_{}_pivot_view".format(model_name.replace(".", "_")) view_id = ( self.env["ir.model.data"] + .sudo() .search( [("name", "=", view_name), ("model", "=", "ir.ui.view")], limit=1,