mirror of
https://github.com/brain-tec/account_ebics.git
synced 2026-08-06 14:42:37 +00:00
Merge pull request #95 from Noviat/18.0
Syncing from upstream Noviat/account_ebics (18.0)
This commit is contained in:
@@ -18,7 +18,7 @@ addon | version | maintainers | summary
|
||||
[account_ebics](account_ebics/) | 18.0.1.2.0 | | EBICS banking protocol
|
||||
[account_ebics_batch](account_ebics_batch/) | 18.0.1.0.0 | | EBICS Files automated import and processing
|
||||
[account_ebics_batch_payment](account_ebics_batch_payment/) | 18.0.1.1.0 | | Upload Batch Payment via EBICS
|
||||
[account_ebics_oca_statement_import](account_ebics_oca_statement_import/) | 18.0.1.0.0 | | Use OCA Bank Statement Import with account_ebics
|
||||
[account_ebics_oca_statement_import](account_ebics_oca_statement_import/) | 18.0.1.0.1 | | Use OCA Bank Statement Import with account_ebics
|
||||
[account_ebics_oe](account_ebics_oe/) | 18.0.1.0.0 | | Deploy account_ebics module on Odoo Enterprise
|
||||
[account_ebics_payment_order](account_ebics_payment_order/) | 18.0.1.2.0 | | Upload Payment Order via EBICS
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
{
|
||||
"name": "account_ebics with OCA Bank Statement Imoort",
|
||||
"summary": "Use OCA Bank Statement Import with account_ebics",
|
||||
"version": "18.0.1.0.0",
|
||||
"version": "18.0.1.0.1",
|
||||
"author": "Noviat",
|
||||
"website": "https://www.noviat.com/",
|
||||
"category": "Hidden",
|
||||
|
||||
@@ -15,25 +15,25 @@ class AccountStatementImport(models.TransientModel):
|
||||
_inherit = "account.statement.import"
|
||||
|
||||
def _match_journal(self, account_number, currency):
|
||||
journal = self.env["account.journal"]
|
||||
if not account_number:
|
||||
return super()._match_journal(account_number, currency)
|
||||
sanitized_account_number = self._sanitize_account_number(account_number)
|
||||
fin_journals = self.env["account.journal"].search(
|
||||
fin_journal = self.env["account.journal"].search(
|
||||
[
|
||||
("type", "=", "bank"),
|
||||
(
|
||||
"bank_account_id.sanitized_acc_number",
|
||||
"like",
|
||||
sanitized_account_number,
|
||||
),
|
||||
"|",
|
||||
("currency_id", "=", currency.id),
|
||||
("company_id.currency_id", "=", currency.id),
|
||||
]
|
||||
)
|
||||
fin_journal = fin_journals.filtered(
|
||||
lambda r: sanitized_account_number
|
||||
in (r.bank_account_id.sanitized_acc_number or "")
|
||||
)
|
||||
if len(fin_journal) == 1:
|
||||
journal = fin_journal
|
||||
if not journal:
|
||||
journal = super()._match_journal(account_number, currency)
|
||||
return journal
|
||||
return fin_journal
|
||||
return super()._match_journal(account_number, currency)
|
||||
|
||||
def _sanitize_account_number(self, account_number):
|
||||
sanitized_number = sanitize_account_number(account_number)
|
||||
|
||||
Reference in New Issue
Block a user