Skip to content

Commit

Permalink
[FIX] account_financial_risk: Sudo on ir.model.data search
Browse files Browse the repository at this point in the history
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
  • Loading branch information
pedrobaeza committed Jul 22, 2024
1 parent 187cce2 commit 8935e93
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion account_financial_risk/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)",
Expand Down
1 change: 1 addition & 0 deletions account_financial_risk/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 8935e93

Please sign in to comment.