mirror of
https://github.com/OCA/bank-statement-import.git
synced 2025-01-20 12:37:43 +02:00
[FIX] account_statement_import_online: further improvements.
This commit is contained in:
committed by
Carolina Fernandez
parent
bbdb843171
commit
fe7adc1bdf
@@ -16,12 +16,16 @@ class AccountJournal(models.Model):
|
||||
selection=lambda self: self.env[
|
||||
"account.journal"
|
||||
]._selection_online_bank_statement_provider(),
|
||||
help="Select the type of service provider (a model)",
|
||||
)
|
||||
online_bank_statement_provider_id = fields.Many2one(
|
||||
string="Statement Provider",
|
||||
comodel_name="online.bank.statement.provider",
|
||||
ondelete="restrict",
|
||||
copy=False,
|
||||
help="Select the actual instance of a configured provider (a record).\n"
|
||||
"Selecting a type of provider will automatically create a provider"
|
||||
" record linked to this journal.",
|
||||
)
|
||||
|
||||
def __get_bank_statements_available_sources(self):
|
||||
@@ -37,12 +41,14 @@ class AccountJournal(models.Model):
|
||||
|
||||
@api.model
|
||||
def values_online_bank_statement_provider(self):
|
||||
"""Return values for provider type selection in the form view."""
|
||||
res = self.env["online.bank.statement.provider"]._get_available_services()
|
||||
if self.user_has_groups("base.group_no_one"):
|
||||
res += [("dummy", "Dummy")]
|
||||
return res
|
||||
|
||||
def _update_online_bank_statement_provider_id(self):
|
||||
"""Keep provider synchronized with journal."""
|
||||
OnlineBankStatementProvider = self.env["online.bank.statement.provider"]
|
||||
for journal in self.filtered("id"):
|
||||
provider_id = journal.online_bank_statement_provider_id
|
||||
|
||||
Reference in New Issue
Block a user