[FIX+IMP] account_statement_import: Several things post-migration:

* Read action with sudo. If not, other users from admin ones can't
  import statements.
* Icon revamp. Now the icon is used (PNG export was needed), and a bit
  of tuning has been made for better appeal.
This commit is contained in:
Pedro M. Baeza
2021-02-09 20:09:05 +01:00
committed by Alexis de Lattre
parent 634dc34011
commit 0ad636d3e0
5 changed files with 84 additions and 211 deletions

View File

@@ -25,8 +25,10 @@ class AccountJournal(models.Model):
def import_statement(self):
"""return action to import bank/cash statements.
This button should be called only on journals with type =='bank'"""
action = self.env.ref(
"account_statement_import.account_statement_import_action"
).read()[0]
action = (
self.env.ref("account_statement_import.account_statement_import_action")
.sudo()
.read()[0]
)
action["context"] = {"journal_id": self.id}
return action