mirror of
https://github.com/OCA/bank-statement-import.git
synced 2025-01-20 12:37:43 +02:00
[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:
@@ -6,7 +6,7 @@
|
|||||||
{
|
{
|
||||||
"name": "Import Statement Files",
|
"name": "Import Statement Files",
|
||||||
"category": "Accounting",
|
"category": "Accounting",
|
||||||
"version": "14.0.1.1.1",
|
"version": "14.0.1.1.2",
|
||||||
"license": "LGPL-3",
|
"license": "LGPL-3",
|
||||||
"depends": ["account"],
|
"depends": ["account"],
|
||||||
"author": "Odoo SA, Akretion, Odoo Community Association (OCA)",
|
"author": "Odoo SA, Akretion, Odoo Community Association (OCA)",
|
||||||
|
|||||||
@@ -38,7 +38,9 @@ class AccountStatementImport(models.TransientModel):
|
|||||||
logger.debug("result=%s", result)
|
logger.debug("result=%s", result)
|
||||||
self.env["ir.attachment"].create(self._prepare_create_attachment(result))
|
self.env["ir.attachment"].create(self._prepare_create_attachment(result))
|
||||||
if self.env.context.get("return_regular_interface_action"):
|
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:
|
if len(result["statement_ids"]) == 1:
|
||||||
action.update(
|
action.update(
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user