mirror of
https://github.com/OCA/bank-statement-import.git
synced 2025-01-20 12:37:43 +02:00
[IMP] account_bank_statement_import: black, isort
This commit is contained in:
committed by
Alexis de Lattre
parent
0b5538708c
commit
3924f85c6d
@@ -1,16 +1,14 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2004-2020 Odoo S.A.
|
||||
# Licence LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0).
|
||||
|
||||
from odoo import models, api, _
|
||||
from odoo import _, api, models
|
||||
|
||||
|
||||
class AccountJournal(models.Model):
|
||||
_inherit = "account.journal"
|
||||
|
||||
def _get_bank_statements_available_import_formats(self):
|
||||
""" Returns a list of strings representing the supported import formats.
|
||||
"""
|
||||
"""Returns a list of strings representing the supported import formats."""
|
||||
return []
|
||||
|
||||
def __get_bank_statements_available_sources(self):
|
||||
@@ -18,14 +16,14 @@ class AccountJournal(models.Model):
|
||||
formats_list = self._get_bank_statements_available_import_formats()
|
||||
if formats_list:
|
||||
formats_list.sort()
|
||||
import_formats_str = ', '.join(formats_list)
|
||||
import_formats_str = ", ".join(formats_list)
|
||||
rslt.append(("file_import", _("Import") + "(" + import_formats_str + ")"))
|
||||
return rslt
|
||||
|
||||
def import_statement(self):
|
||||
"""return action to import bank/cash statements. This button should be called only on journals with type =='bank'"""
|
||||
action_name = 'action_account_bank_statement_import'
|
||||
[action] = self.env.ref('account_bank_statement_import.%s' % action_name).read()
|
||||
action_name = "action_account_bank_statement_import"
|
||||
[action] = self.env.ref("account_bank_statement_import.%s" % action_name).read()
|
||||
# Note: this drops action['context'], which is a dict stored as a string, which is not easy to update
|
||||
action.update({'context': (u"{'journal_id': " + str(self.id) + u"}")})
|
||||
action.update({"context": (u"{'journal_id': " + str(self.id) + u"}")})
|
||||
return action
|
||||
|
||||
Reference in New Issue
Block a user