[FIX] account_statement_import: Read action with sudo

If not, other users except admins can't import statements.

Remaining thing from previous patch.
This commit is contained in:
Pedro M. Baeza
2021-02-15 09:45:16 +01:00
parent cc7cf4674a
commit 2ce3f4da86
2 changed files with 4 additions and 2 deletions

View File

@@ -6,7 +6,7 @@
{
"name": "Import Statement Files",
"category": "Accounting",
"version": "14.0.1.1.1",
"version": "14.0.1.1.2",
"license": "LGPL-3",
"depends": ["account"],
"author": "Odoo SA, Akretion, Odoo Community Association (OCA)",

View File

@@ -38,7 +38,9 @@ class AccountStatementImport(models.TransientModel):
logger.debug("result=%s", result)
self.env["ir.attachment"].create(self._prepare_create_attachment(result))
if self.env.context.get("return_regular_interface_action"):
action = self.env.ref("account.action_bank_statement_tree").read([])[0]
action = (
self.env.ref("account.action_bank_statement_tree").sudo().read([])[0]
)
if len(result["statement_ids"]) == 1:
action.update(
{