mirror of
https://github.com/brain-tec/account_ebics.git
synced 2026-10-16 07:49:07 +00:00
Merge pull request #114 from Noviat/17.0
Syncing from upstream Noviat/account_ebics (17.0)
This commit is contained in:
3 files changed
+26
-20
No files matched your search
@@ -15,7 +15,7 @@ Available addons
|
||||
----------------
|
||||
addon | version | maintainers | summary
|
||||
--- | --- | --- | ---
|
||||
[account_ebics](account_ebics/) | 17.0.1.3.0 | | Download bank statements and upload payment files directly from Odoo, using the European EBICS standard
|
||||
[account_ebics](account_ebics/) | 17.0.1.3.1 | | Download bank statements and upload payment files directly from Odoo, using the European EBICS standard
|
||||
[account_ebics_batch](account_ebics_batch/) | 17.0.1.0.1 | | Download and process your EBICS files automatically, on a schedule
|
||||
[account_ebics_batch_payment](account_ebics_batch_payment/) | 17.0.1.1.0 | | Send an Odoo Enterprise batch payment to the bank over EBICS
|
||||
[account_ebics_oca_statement_import](account_ebics_oca_statement_import/) | 17.0.1.0.1 | | Process EBICS statement files with the OCA bank statement import
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
"Download bank statements and upload payment files directly from Odoo, "
|
||||
"using the European EBICS standard"
|
||||
),
|
||||
"version": "17.0.1.3.0",
|
||||
"version": "17.0.1.3.1",
|
||||
"license": "LGPL-3",
|
||||
"author": "Noviat",
|
||||
"website": "https://www.noviat.com/",
|
||||
|
||||
@@ -583,9 +583,21 @@ class EbicsFile(models.Model):
|
||||
message = _("No bank account number found.")
|
||||
res["notifications"].append({"type": "error", "message": message})
|
||||
continue
|
||||
currency_code = stmt.xpath(
|
||||
if not stmt.findall("ns:Ntry", ns):
|
||||
continue
|
||||
currency_codes = stmt.xpath(
|
||||
"ns:Acct/ns:Ccy/text() | ns:Bal/ns:Amt/@Ccy", namespaces=ns
|
||||
)[0]
|
||||
)
|
||||
if not currency_codes and camt_variant == "054":
|
||||
currency_codes = stmt.xpath("ns:Ntry/ns:Amt/@Ccy", namespaces=ns)
|
||||
if not currency_codes:
|
||||
message = _(
|
||||
"No currency found in statement for Account Number %(nbr)s.",
|
||||
nbr=acc_number,
|
||||
)
|
||||
res["notifications"].append({"type": "error", "message": message})
|
||||
continue
|
||||
currency_code = currency_codes[0]
|
||||
# some banks (e.g. COMMERZBANK) add the currency as the last 3 digits
|
||||
# of the bank account number hence we need to remove this since otherwise
|
||||
# the journal matching logic fails
|
||||
@@ -593,26 +605,20 @@ class EbicsFile(models.Model):
|
||||
acc_number = acc_number[:-3]
|
||||
|
||||
root_new = deepcopy(root)
|
||||
entries = False
|
||||
for j, el in enumerate(root_new[0].findall(f"ns:{camt_tag}", ns)):
|
||||
if j != i:
|
||||
el.getparent().remove(el)
|
||||
else:
|
||||
entries = el.findall("ns:Ntry", ns)
|
||||
if not entries:
|
||||
currency, journal = self._lookup_journal(res, acc_number, currency_code)
|
||||
if not (currency and journal):
|
||||
continue
|
||||
else:
|
||||
currency, journal = self._lookup_journal(res, acc_number, currency_code)
|
||||
if not (currency and journal):
|
||||
continue
|
||||
datas.append(
|
||||
{
|
||||
"acc_number": acc_number,
|
||||
"journal_id": journal.id,
|
||||
"company_id": journal.company_id.id,
|
||||
"data": base64.b64encode(etree.tostring(root_new)),
|
||||
}
|
||||
)
|
||||
datas.append(
|
||||
{
|
||||
"acc_number": acc_number,
|
||||
"journal_id": journal.id,
|
||||
"company_id": journal.company_id.id,
|
||||
"data": base64.b64encode(etree.tostring(root_new)),
|
||||
}
|
||||
)
|
||||
|
||||
return datas
|
||||
|
||||
|
||||
Reference in new issue
Block a user