[IMP] account_bank_statement_import_online: allow pull if archived

[UPD] Update account_bank_statement_import_online.pot

account_bank_statement_import_online 12.0.1.3.0
This commit is contained in:
Alexey Pelykh
2020-04-11 10:21:01 +02:00
parent 108dd51579
commit 9a1c1a4f4b
9 changed files with 101 additions and 23 deletions

View File

@@ -1,5 +1,5 @@
# Copyright 2019 Brainbean Apps (https://brainbeanapps.com)
# Copyright 2019 Dataplug (https://dataplug.io)
# Copyright 2019-2020 Brainbean Apps (https://brainbeanapps.com)
# Copyright 2019-2020 Dataplug (https://dataplug.io)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
import logging
@@ -37,9 +37,12 @@ class AccountJournal(models.Model):
@api.model
def values_online_bank_statement_provider(self):
return self.env[
res = self.env[
'online.bank.statement.provider'
]._get_available_services()
if self.user_has_groups('base.group_no_one'):
res += [('dummy', 'Dummy')]
return res
@api.multi
def _update_online_bank_statement_provider_id(self):
@@ -92,5 +95,6 @@ class AccountJournal(models.Model):
'target': 'new',
'context': {
'default_provider_ids': [(6, False, provider_ids)],
'active_test': False,
},
}

View File

@@ -217,7 +217,9 @@ class OnlineBankStatementProvider(models.Model):
'journal_id': provider.journal_id.id,
'date': statement_date,
})
statement = AccountBankStatement.create(
statement = AccountBankStatement.with_context(
journal_id=provider.journal_id.id,
).create(
# NOTE: This is needed since create() alters values
statement_values.copy()
)
@@ -275,9 +277,9 @@ class OnlineBankStatementProvider(models.Model):
statement_values['balance_start'] = float(
statement_values['balance_start']
)
if 'balance_start' in statement_values:
statement_values['balance_start'] = float(
statement_values['balance_start']
if 'balance_end_real' in statement_values:
statement_values['balance_end_real'] = float(
statement_values['balance_end_real']
)
statement.write(statement_values)
statement_date_since = statement_date_until