mirror of
https://github.com/brain-tec/account_ebics.git
synced 2024-12-23 18:01:45 +00:00
[IMP] account_ebics: pre-commit
This commit is contained in:
parent
c17100ee23
commit
0f3169e375
@ -17,7 +17,7 @@ rebel_module_groups: []
|
||||
repo_description: 'EBICS support for Odoo'
|
||||
repo_name: account_ebics
|
||||
repo_slug: account_ebics
|
||||
repo_website: https://github.com/Noviat/account_ebics
|
||||
repo_website: https://www.noviat.com
|
||||
travis_apt_packages: []
|
||||
travis_apt_sources: []
|
||||
|
||||
|
@ -36,7 +36,7 @@ repos:
|
||||
# update the NOT INSTALLABLE ADDONS section above
|
||||
- id: oca-update-pre-commit-excluded-addons
|
||||
- id: oca-fix-manifest-website
|
||||
args: ["https://www.noviat.com/"]
|
||||
args: ["https://www.noviat.com"]
|
||||
- repo: https://github.com/myint/autoflake
|
||||
rev: v1.7.7
|
||||
hooks:
|
||||
|
@ -3,10 +3,10 @@
|
||||
|
||||
{
|
||||
"name": "EBICS banking protocol",
|
||||
"version": "14.0.1.0.5",
|
||||
"version": "15.0.1.0.0",
|
||||
"license": "LGPL-3",
|
||||
"author": "Noviat",
|
||||
"website": "https://github.com/Noviat/account_ebics",
|
||||
"website": "https://www.noviat.com",
|
||||
"category": "Accounting & Finance",
|
||||
"depends": ["account"],
|
||||
"data": [
|
||||
|
@ -1,180 +1,174 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
<data noupdate="1">
|
||||
<odoo noupdate="1">
|
||||
|
||||
<!-- Download formats -->
|
||||
<!-- Download formats -->
|
||||
|
||||
<record id="ebics_ff_C52" model="ebics.file.format">
|
||||
<field name="name">camt.052</field>
|
||||
<field name="type">down</field>
|
||||
<field name="order_type">C52</field>
|
||||
<field name="download_process_method">camt.052</field>
|
||||
<field
|
||||
name="description"
|
||||
>bank to customer account report in format camt.052</field>
|
||||
<field name="suffix">c52.xml</field>
|
||||
</record>
|
||||
<record id="ebics_ff_C52" model="ebics.file.format">
|
||||
<field name="name">camt.052</field>
|
||||
<field name="type">down</field>
|
||||
<field name="order_type">C52</field>
|
||||
<field name="download_process_method">camt.052</field>
|
||||
<field name="description">bank to customer account report in format camt.052</field>
|
||||
<field name="suffix">c52.xml</field>
|
||||
</record>
|
||||
|
||||
<record id="ebics_ff_Z52" model="ebics.file.format">
|
||||
<field name="name">camt.052</field>
|
||||
<field name="type">down</field>
|
||||
<field name="order_type">Z52</field>
|
||||
<field name="download_process_method">camt.052</field>
|
||||
<field
|
||||
name="description"
|
||||
>bank to customer account report in format camt.052</field>
|
||||
<field name="suffix">c52.xml</field>
|
||||
</record>
|
||||
<record id="ebics_ff_Z52" model="ebics.file.format">
|
||||
<field name="name">camt.052</field>
|
||||
<field name="type">down</field>
|
||||
<field name="order_type">Z52</field>
|
||||
<field name="download_process_method">camt.052</field>
|
||||
<field name="description">bank to customer account report in format camt.052</field>
|
||||
<field name="suffix">c52.xml</field>
|
||||
</record>
|
||||
|
||||
<record id="ebics_ff_C53" model="ebics.file.format">
|
||||
<field name="name">camt.053</field>
|
||||
<field name="type">down</field>
|
||||
<field name="order_type">C53</field>
|
||||
<field name="download_process_method">camt.053</field>
|
||||
<field
|
||||
name="description"
|
||||
>Bank to customer statement report in format camt.053</field>
|
||||
<field name="suffix">c53.xml</field>
|
||||
</record>
|
||||
<record id="ebics_ff_C53" model="ebics.file.format">
|
||||
<field name="name">camt.053</field>
|
||||
<field name="type">down</field>
|
||||
<field name="order_type">C53</field>
|
||||
<field name="download_process_method">camt.053</field>
|
||||
<field
|
||||
name="description"
|
||||
>Bank to customer statement report in format camt.053</field>
|
||||
<field name="suffix">c53.xml</field>
|
||||
</record>
|
||||
|
||||
<record id="ebics_ff_Z53" model="ebics.file.format">
|
||||
<field name="name">camt.053</field>
|
||||
<field name="type">down</field>
|
||||
<field name="order_type">Z53</field>
|
||||
<field name="download_process_method">camt.053</field>
|
||||
<field
|
||||
name="description"
|
||||
>Bank to customer statement report in format camt.053</field>
|
||||
<field name="suffix">c53.xml</field>
|
||||
</record>
|
||||
<record id="ebics_ff_Z53" model="ebics.file.format">
|
||||
<field name="name">camt.053</field>
|
||||
<field name="type">down</field>
|
||||
<field name="order_type">Z53</field>
|
||||
<field name="download_process_method">camt.053</field>
|
||||
<field
|
||||
name="description"
|
||||
>Bank to customer statement report in format camt.053</field>
|
||||
<field name="suffix">c53.xml</field>
|
||||
</record>
|
||||
|
||||
<record id="ebics_ff_C54" model="ebics.file.format">
|
||||
<field name="name">camt.054</field>
|
||||
<field name="type">down</field>
|
||||
<field name="order_type">C54</field>
|
||||
<field name="download_process_method">camt.054</field>
|
||||
<field
|
||||
name="description"
|
||||
>Bank to customer debit credit notification in format camt.054</field>
|
||||
<field name="suffix">c52.xml</field>
|
||||
</record>
|
||||
<record id="ebics_ff_C54" model="ebics.file.format">
|
||||
<field name="name">camt.054</field>
|
||||
<field name="type">down</field>
|
||||
<field name="order_type">C54</field>
|
||||
<field name="download_process_method">camt.054</field>
|
||||
<field
|
||||
name="description"
|
||||
>Bank to customer debit credit notification in format camt.054</field>
|
||||
<field name="suffix">c52.xml</field>
|
||||
</record>
|
||||
|
||||
<record id="ebics_ff_Z54" model="ebics.file.format">
|
||||
<field name="name">camt.054</field>
|
||||
<field name="type">down</field>
|
||||
<field name="order_type">Z54</field>
|
||||
<field name="download_process_method">camt.054</field>
|
||||
<field
|
||||
name="description"
|
||||
>Bank to customer debit credit notification in format camt.054</field>
|
||||
<field name="suffix">c52.xml</field>
|
||||
</record>
|
||||
<record id="ebics_ff_Z54" model="ebics.file.format">
|
||||
<field name="name">camt.054</field>
|
||||
<field name="type">down</field>
|
||||
<field name="order_type">Z54</field>
|
||||
<field name="download_process_method">camt.054</field>
|
||||
<field
|
||||
name="description"
|
||||
>Bank to customer debit credit notification in format camt.054</field>
|
||||
<field name="suffix">c52.xml</field>
|
||||
</record>
|
||||
|
||||
<record id="ebics_ff_FDL_camt_xxx_cfonb120_stm" model="ebics.file.format">
|
||||
<field name="name">camt.xxx.cfonb120.stm</field>
|
||||
<field name="type">down</field>
|
||||
<field name="order_type">FDL</field>
|
||||
<field name="download_process_method">cfonb120</field>
|
||||
<field
|
||||
name="description"
|
||||
>Bank to customer statement report in format cfonb120</field>
|
||||
<field name="suffix">cfonb120.dat</field>
|
||||
</record>
|
||||
<record id="ebics_ff_FDL_camt_xxx_cfonb120_stm" model="ebics.file.format">
|
||||
<field name="name">camt.xxx.cfonb120.stm</field>
|
||||
<field name="type">down</field>
|
||||
<field name="order_type">FDL</field>
|
||||
<field name="download_process_method">cfonb120</field>
|
||||
<field
|
||||
name="description"
|
||||
>Bank to customer statement report in format cfonb120</field>
|
||||
<field name="suffix">cfonb120.dat</field>
|
||||
</record>
|
||||
|
||||
<record id="ebics_ff_CDZ" model="ebics.file.format">
|
||||
<field name="name">pain.002</field>
|
||||
<field name="type">down</field>
|
||||
<field name="order_type">CDZ</field>
|
||||
<field
|
||||
name="description"
|
||||
>Payment status report for direct debit in format pain.002</field>
|
||||
<field name="suffix">psr.xml</field>
|
||||
</record>
|
||||
<record id="ebics_ff_CDZ" model="ebics.file.format">
|
||||
<field name="name">pain.002</field>
|
||||
<field name="type">down</field>
|
||||
<field name="order_type">CDZ</field>
|
||||
<field
|
||||
name="description"
|
||||
>Payment status report for direct debit in format pain.002</field>
|
||||
<field name="suffix">psr.xml</field>
|
||||
</record>
|
||||
|
||||
<record id="ebics_ff_Z01" model="ebics.file.format">
|
||||
<field name="name">pain.002</field>
|
||||
<field name="type">down</field>
|
||||
<field name="order_type">Z01</field>
|
||||
<field name="download_process_method">pain.002</field>
|
||||
<field
|
||||
name="description"
|
||||
>Payment status report for direct debit in format pain.002</field>
|
||||
<field name="suffix">psr.xml</field>
|
||||
</record>
|
||||
<record id="ebics_ff_Z01" model="ebics.file.format">
|
||||
<field name="name">pain.002</field>
|
||||
<field name="type">down</field>
|
||||
<field name="order_type">Z01</field>
|
||||
<field name="download_process_method">pain.002</field>
|
||||
<field
|
||||
name="description"
|
||||
>Payment status report for direct debit in format pain.002</field>
|
||||
<field name="suffix">psr.xml</field>
|
||||
</record>
|
||||
|
||||
<!-- Upload formats -->
|
||||
<!-- Upload formats -->
|
||||
|
||||
<record id="ebics_ff_LCR" model="ebics.file.format">
|
||||
<field name="name">pain.xxx.cfonb160.dco</field>
|
||||
<field name="type">up</field>
|
||||
<field name="order_type">FUL</field>
|
||||
<field name="description">Remises de LCR</field>
|
||||
<field name="suffix">txt</field>
|
||||
</record>
|
||||
<record id="ebics_ff_LCR" model="ebics.file.format">
|
||||
<field name="name">pain.xxx.cfonb160.dco</field>
|
||||
<field name="type">up</field>
|
||||
<field name="order_type">FUL</field>
|
||||
<field name="description">Remises de LCR</field>
|
||||
<field name="suffix">txt</field>
|
||||
</record>
|
||||
|
||||
<record id="ebics_ff_CCT" model="ebics.file.format">
|
||||
<field name="name">pain.001.001.03</field>
|
||||
<field name="type">up</field>
|
||||
<field name="order_type">CCT</field>
|
||||
<field name="description">Payment Order in format pain.001.001.03</field>
|
||||
<field name="suffix">xml</field>
|
||||
</record>
|
||||
<record id="ebics_ff_CCT" model="ebics.file.format">
|
||||
<field name="name">pain.001.001.03</field>
|
||||
<field name="type">up</field>
|
||||
<field name="order_type">CCT</field>
|
||||
<field name="description">Payment Order in format pain.001.001.03</field>
|
||||
<field name="suffix">xml</field>
|
||||
</record>
|
||||
|
||||
<record id="ebics_ff_XE2" model="ebics.file.format">
|
||||
<field name="name">pain.001.001.03</field>
|
||||
<field name="type">up</field>
|
||||
<field name="order_type">XE2</field>
|
||||
<field name="description">Payment Order in format pain.001.001.03</field>
|
||||
<field name="suffix">xml</field>
|
||||
</record>
|
||||
<record id="ebics_ff_XE2" model="ebics.file.format">
|
||||
<field name="name">pain.001.001.03</field>
|
||||
<field name="type">up</field>
|
||||
<field name="order_type">XE2</field>
|
||||
<field name="description">Payment Order in format pain.001.001.03</field>
|
||||
<field name="suffix">xml</field>
|
||||
</record>
|
||||
|
||||
<record id="ebics_ff_CDD" model="ebics.file.format">
|
||||
<field name="name">pain.008.001.02.sdd</field>
|
||||
<field name="type">up</field>
|
||||
<field name="order_type">CDD</field>
|
||||
<field
|
||||
name="description"
|
||||
>Sepa Core Direct Debit Order in format pain.008.001.02</field>
|
||||
<field name="suffix">xml</field>
|
||||
</record>
|
||||
<record id="ebics_ff_CDD" model="ebics.file.format">
|
||||
<field name="name">pain.008.001.02.sdd</field>
|
||||
<field name="type">up</field>
|
||||
<field name="order_type">CDD</field>
|
||||
<field
|
||||
name="description"
|
||||
>Sepa Core Direct Debit Order in format pain.008.001.02</field>
|
||||
<field name="suffix">xml</field>
|
||||
</record>
|
||||
|
||||
<record id="ebics_ff_XE3" model="ebics.file.format">
|
||||
<field name="name">pain.008.001.02.sdd</field>
|
||||
<field name="type">up</field>
|
||||
<field name="order_type">XE3</field>
|
||||
<field
|
||||
name="description"
|
||||
>Sepa Core Direct Debit Order in format pain.008.001.02</field>
|
||||
<field name="suffix">xml</field>
|
||||
</record>
|
||||
<record id="ebics_ff_XE3" model="ebics.file.format">
|
||||
<field name="name">pain.008.001.02.sdd</field>
|
||||
<field name="type">up</field>
|
||||
<field name="order_type">XE3</field>
|
||||
<field
|
||||
name="description"
|
||||
>Sepa Core Direct Debit Order in format pain.008.001.02</field>
|
||||
<field name="suffix">xml</field>
|
||||
</record>
|
||||
|
||||
<record id="ebics_ff_CDB" model="ebics.file.format">
|
||||
<field name="name">pain.008.001.02.sbb</field>
|
||||
<field name="type">up</field>
|
||||
<field name="order_type">CDB</field>
|
||||
<field
|
||||
name="description"
|
||||
>Sepa Direct Debit (B2B) Order in format pain.008.001.02</field>
|
||||
<field name="suffix">xml</field>
|
||||
</record>
|
||||
<record id="ebics_ff_CDB" model="ebics.file.format">
|
||||
<field name="name">pain.008.001.02.sbb</field>
|
||||
<field name="type">up</field>
|
||||
<field name="order_type">CDB</field>
|
||||
<field
|
||||
name="description"
|
||||
>Sepa Direct Debit (B2B) Order in format pain.008.001.02</field>
|
||||
<field name="suffix">xml</field>
|
||||
</record>
|
||||
|
||||
<record id="ebics_ff_XE4" model="ebics.file.format">
|
||||
<field name="name">pain.008.001.02.sbb</field>
|
||||
<field name="type">up</field>
|
||||
<field name="order_type">XE4</field>
|
||||
<field
|
||||
name="description"
|
||||
>Sepa Direct Debit (B2B) Order in format pain.008.001.02</field>
|
||||
<field name="suffix">xml</field>
|
||||
</record>
|
||||
<record id="ebics_ff_XE4" model="ebics.file.format">
|
||||
<field name="name">pain.008.001.02.sbb</field>
|
||||
<field name="type">up</field>
|
||||
<field name="order_type">XE4</field>
|
||||
<field
|
||||
name="description"
|
||||
>Sepa Direct Debit (B2B) Order in format pain.008.001.02</field>
|
||||
<field name="suffix">xml</field>
|
||||
</record>
|
||||
|
||||
<record id="ebics_ff_FUL_pain_001_001_02_sct" model="ebics.file.format">
|
||||
<field name="name">pain.001.001.02.sct</field>
|
||||
<field name="type">up</field>
|
||||
<field name="order_type">FUL</field>
|
||||
<field name="description">Payment Order in format pain.001.001.02</field>
|
||||
<field name="suffix">xml</field>
|
||||
</record>
|
||||
<record id="ebics_ff_FUL_pain_001_001_02_sct" model="ebics.file.format">
|
||||
<field name="name">pain.001.001.02.sct</field>
|
||||
<field name="type">up</field>
|
||||
<field name="order_type">FUL</field>
|
||||
<field name="description">Payment Order in format pain.001.001.02</field>
|
||||
<field name="suffix">xml</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Copyright 2009-2020 Noviat.
|
||||
# Copyright 2009-2022 Noviat.
|
||||
# License LGPL-3 or later (http://www.gnu.org/licenses/lpgl).
|
||||
|
||||
from odoo import fields, models
|
||||
|
@ -22,7 +22,6 @@ class EbicsConfig(models.Model):
|
||||
_order = "name"
|
||||
|
||||
name = fields.Char(
|
||||
string="Name",
|
||||
readonly=True,
|
||||
states={"draft": [("readonly", False)]},
|
||||
required=True,
|
||||
@ -131,7 +130,6 @@ class EbicsConfig(models.Model):
|
||||
)
|
||||
state = fields.Selection(
|
||||
[("draft", "Draft"), ("confirm", "Confirmed")],
|
||||
string="State",
|
||||
default="draft",
|
||||
required=True,
|
||||
readonly=True,
|
||||
@ -144,7 +142,7 @@ class EbicsConfig(models.Model):
|
||||
"\nThis number should match the following pattern : "
|
||||
"[A-Z]{1}[A-Z0-9]{3}",
|
||||
)
|
||||
active = fields.Boolean(string="Active", default=True)
|
||||
active = fields.Boolean(default=True)
|
||||
company_ids = fields.Many2many(
|
||||
comodel_name="res.company",
|
||||
string="Companies",
|
||||
|
@ -46,7 +46,6 @@ class EbicsFile(models.Model):
|
||||
)
|
||||
state = fields.Selection(
|
||||
[("draft", "Draft"), ("done", "Done")],
|
||||
string="State",
|
||||
default="draft",
|
||||
required=True,
|
||||
readonly=True,
|
||||
@ -93,8 +92,7 @@ class EbicsFile(models.Model):
|
||||
|
||||
def process(self):
|
||||
self.ensure_one()
|
||||
ctx = dict(self.env.context, allowed_company_ids=self.env.user.company_ids.ids)
|
||||
self = self.with_context(ctx)
|
||||
self = self.with_context(allowed_company_ids=self.env.user.company_ids.ids)
|
||||
self.note_process = ""
|
||||
ff_methods = self._file_format_methods()
|
||||
ff = self.format_id.download_process_method
|
||||
@ -159,11 +157,12 @@ class EbicsFile(models.Model):
|
||||
if raise_if_not_found:
|
||||
raise UserError(
|
||||
_(
|
||||
"The module to process the '%s' format is not installed "
|
||||
"The module to process the '%(ebics_format)s' format is not installed "
|
||||
"on your system. "
|
||||
"\nPlease install module '%s'"
|
||||
"\nPlease install module '%(module)s'",
|
||||
ebics_format=self.format_id.name,
|
||||
module=module,
|
||||
)
|
||||
% (self.format_id.name, module)
|
||||
)
|
||||
return False
|
||||
return True
|
||||
@ -288,9 +287,12 @@ class EbicsFile(models.Model):
|
||||
"notifications": [],
|
||||
},
|
||||
}
|
||||
wiz_ctx = dict(self.env.context, active_model="ebics.file")
|
||||
for i, wiz_vals in enumerate(wiz_vals_list, start=1):
|
||||
wiz = self.env[wiz_model].with_context(wiz_ctx).create(wiz_vals)
|
||||
wiz = (
|
||||
self.env[wiz_model]
|
||||
.with_context(active_model="ebics.file")
|
||||
.create(wiz_vals)
|
||||
)
|
||||
res = wiz.import_file_button()
|
||||
ctx = res.get("context")
|
||||
if res.get("res_model") == "account.bank.statement.import.journal.creation":
|
||||
@ -360,11 +362,12 @@ class EbicsFile(models.Model):
|
||||
if not found:
|
||||
raise UserError(
|
||||
_(
|
||||
"The module to process the '%s' format is not installed "
|
||||
"on your system. "
|
||||
"\nPlease install one of the following modules: \n%s."
|
||||
"The module to process the '%(ebics_format)s' format is "
|
||||
"not installed on your system. "
|
||||
"\nPlease install one of the following modules: \n%(modules)s.",
|
||||
ebics_format=self.format_id.name,
|
||||
modules=", ".join([x[1] for x in modules]),
|
||||
)
|
||||
% (self.format_id.name, ", ".join([x[1] for x in modules]))
|
||||
)
|
||||
if _src == "oca":
|
||||
self._process_camt053_oca()
|
||||
@ -386,8 +389,9 @@ class EbicsFile(models.Model):
|
||||
"notifications": [],
|
||||
},
|
||||
}
|
||||
wiz_ctx = dict(self.env.context, active_model="ebics.file")
|
||||
wiz = self.env[wiz_model].with_context(wiz_ctx).create(wiz_vals)
|
||||
wiz = (
|
||||
self.env[wiz_model].with_context(active_model="ebics.file").create(wiz_vals)
|
||||
)
|
||||
res = wiz.import_file_button()
|
||||
ctx = res.get("context")
|
||||
if res.get("res_model") == "account.bank.statement.import.journal.creation":
|
||||
@ -418,8 +422,9 @@ class EbicsFile(models.Model):
|
||||
)
|
||||
]
|
||||
}
|
||||
ctx = dict(self.env.context, active_model="ebics.file")
|
||||
wiz = self.env[wiz_model].with_context(ctx).create(wiz_vals)
|
||||
wiz = (
|
||||
self.env[wiz_model].with_context(active_model="ebics.file").create(wiz_vals)
|
||||
)
|
||||
res = wiz.import_file()
|
||||
if res.get("res_model") == "account.bank.statement.import.journal.creation":
|
||||
if res.get("context"):
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Copyright 2009-2020 Noviat.
|
||||
# Copyright 2009-2022 Noviat.
|
||||
# License LGPL-3 or later (http://www.gnu.org/licenses/lpgl).
|
||||
|
||||
from odoo import api, fields, models
|
||||
@ -22,7 +22,6 @@ class EbicsFileFormat(models.Model):
|
||||
selection=[("down", "Download"), ("up", "Upload")], required=True
|
||||
)
|
||||
order_type = fields.Char(
|
||||
string="Order Type",
|
||||
required=True,
|
||||
help="E.g. C53 (check your EBICS contract).\n"
|
||||
"For most banks in France you should use the "
|
||||
@ -40,7 +39,6 @@ class EbicsFileFormat(models.Model):
|
||||
# move signature_class parameter so that it can be set per EBICS config
|
||||
signature_class = fields.Selection(
|
||||
selection=[("E", "Single signature"), ("T", "Transport signature")],
|
||||
string="Signature Class",
|
||||
help="Please doublecheck the security of your Odoo "
|
||||
"ERP system when using class 'E' to prevent unauthorised "
|
||||
"users to make supplier payments."
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Copyright 2009-2020 Noviat.
|
||||
# Copyright 2009-2022 Noviat.
|
||||
# License LGPL-3 or later (http://www.gnu.org/licenses/lpgl).
|
||||
|
||||
import base64
|
||||
@ -75,7 +75,6 @@ class EbicsUserID(models.Model):
|
||||
# Classes A and B are not yet supported.
|
||||
signature_class = fields.Selection(
|
||||
selection=[("E", "Single signature"), ("T", "Transport signature")],
|
||||
string="Signature Class",
|
||||
required=True,
|
||||
default="T",
|
||||
readonly=True,
|
||||
@ -157,12 +156,11 @@ class EbicsUserID(models.Model):
|
||||
("to_verify", "Verification"),
|
||||
("active_keys", "Active Keys"),
|
||||
],
|
||||
string="State",
|
||||
default="draft",
|
||||
required=True,
|
||||
readonly=True,
|
||||
)
|
||||
active = fields.Boolean(string="Active", default=True)
|
||||
active = fields.Boolean(default=True)
|
||||
company_ids = fields.Many2many(
|
||||
comodel_name="res.company",
|
||||
string="Companies",
|
||||
@ -243,11 +241,11 @@ class EbicsUserID(models.Model):
|
||||
partnerid=self.ebics_config_id.ebics_partner,
|
||||
userid=self.name,
|
||||
)
|
||||
except Exception:
|
||||
except Exception as err:
|
||||
exctype, value = exc_info()[:2]
|
||||
error = _("EBICS Initialisation Error:")
|
||||
error += "\n" + str(exctype) + "\n" + str(value)
|
||||
raise UserError(error)
|
||||
raise UserError(error) from err
|
||||
|
||||
self.ebics_config_id._check_ebics_keys()
|
||||
if not os.path.isfile(self.ebics_keys_fn):
|
||||
@ -265,11 +263,11 @@ class EbicsUserID(models.Model):
|
||||
keyversion=self.ebics_config_id.ebics_key_version,
|
||||
bitlength=self.ebics_config_id.ebics_key_bitlength,
|
||||
)
|
||||
except Exception:
|
||||
except Exception as err:
|
||||
exctype, value = exc_info()[:2]
|
||||
error = _("EBICS Initialisation Error:")
|
||||
error += "\n" + str(exctype) + "\n" + str(value)
|
||||
raise UserError(error)
|
||||
raise UserError(error) from err
|
||||
|
||||
if self.swift_3skey and not self.ebics_key_x509:
|
||||
raise UserError(
|
||||
@ -314,7 +312,7 @@ class EbicsUserID(models.Model):
|
||||
_logger.info("%s, EBICS INI command, OrderID=%s", self._name, OrderID)
|
||||
if ebics_version == "H003":
|
||||
self.ebics_config_id._update_order_number(OrderID)
|
||||
except URLError:
|
||||
except URLError as err:
|
||||
exctype, value = exc_info()[:2]
|
||||
tb = "".join(format_exception(*exc_info()))
|
||||
_logger.error(
|
||||
@ -323,21 +321,22 @@ class EbicsUserID(models.Model):
|
||||
tb,
|
||||
)
|
||||
raise UserError(
|
||||
_("urlopen error:\n url '%s' - %s")
|
||||
% (self.ebics_config_id.ebics_url, str(value))
|
||||
)
|
||||
except EbicsFunctionalError:
|
||||
_("urlopen error:\n url '%(url)s' - %(val)s"),
|
||||
url=self.ebics_config_id.ebics_url,
|
||||
val=str(value),
|
||||
) from err
|
||||
except EbicsFunctionalError as err:
|
||||
e = exc_info()
|
||||
error = _("EBICS Functional Error:")
|
||||
error += "\n"
|
||||
error += "{} (code: {})".format(e[1].message, e[1].code)
|
||||
raise UserError(error)
|
||||
except EbicsTechnicalError:
|
||||
raise UserError(error) from err
|
||||
except EbicsTechnicalError as err:
|
||||
e = exc_info()
|
||||
error = _("EBICS Technical Error:")
|
||||
error += "\n"
|
||||
error += "{} (code: {})".format(e[1].message, e[1].code)
|
||||
raise UserError(error)
|
||||
raise UserError(error) from err
|
||||
|
||||
# Send the public authentication and encryption keys to the bank.
|
||||
if ebics_version == "H003":
|
||||
@ -411,25 +410,25 @@ class EbicsUserID(models.Model):
|
||||
userid=self.name,
|
||||
)
|
||||
client = EbicsClient(bank, user, version=self.ebics_config_id.ebics_version)
|
||||
except Exception:
|
||||
except Exception as err:
|
||||
exctype, value = exc_info()[:2]
|
||||
error = _("EBICS Initialisation Error:")
|
||||
error += "\n" + str(exctype) + "\n" + str(value)
|
||||
raise UserError(error)
|
||||
raise UserError(error) from err
|
||||
|
||||
try:
|
||||
public_bank_keys = client.HPB()
|
||||
except EbicsFunctionalError:
|
||||
except EbicsFunctionalError as err:
|
||||
e = exc_info()
|
||||
error = _("EBICS Functional Error:")
|
||||
error += "\n"
|
||||
error += "{} (code: {})".format(e[1].message, e[1].code)
|
||||
raise UserError(error)
|
||||
except Exception:
|
||||
raise UserError(error) from err
|
||||
except Exception as err:
|
||||
exctype, value = exc_info()[:2]
|
||||
error = _("EBICS Initialisation Error:")
|
||||
error += "\n" + str(exctype) + "\n" + str(value)
|
||||
raise UserError(error)
|
||||
raise UserError(error) from err
|
||||
|
||||
public_bank_keys = public_bank_keys.encode()
|
||||
tmp_dir = os.path.normpath(self.ebics_config_id.ebics_files + "/tmp")
|
||||
|
@ -5,7 +5,7 @@
|
||||
<field name="name">ebics.config.tree</field>
|
||||
<field name="model">ebics.config</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="EBICS Configuration" decoration-muted="state == 'draft'">
|
||||
<tree decoration-muted="state == 'draft'">
|
||||
<field name="name" />
|
||||
<field name="ebics_host" />
|
||||
<field name="state" />
|
||||
|
@ -5,7 +5,7 @@
|
||||
<field name="name">ebics.file.format.tree</field>
|
||||
<field name="model">ebics.file.format</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="EBICS File Formats">
|
||||
<tree>
|
||||
<field name="type" />
|
||||
<field name="order_type" />
|
||||
<field name="signature_class" />
|
||||
|
@ -38,7 +38,7 @@
|
||||
<field name="name">ebics.file.tree</field>
|
||||
<field name="model">ebics.file</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="EBICS Files" decoration-muted="state=='draft'" create="false">
|
||||
<tree decoration-muted="state=='draft'" create="false">
|
||||
<field name="date" string="Download Date" />
|
||||
<field name="name" />
|
||||
<field name="date_from" />
|
||||
@ -169,7 +169,7 @@
|
||||
<field name="name">ebics.file.tree</field>
|
||||
<field name="model">ebics.file</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="EBICS Files" decoration-muted="state=='draft'" create="false">
|
||||
<tree decoration-muted="state=='draft'" create="false">
|
||||
<field name="date" string="Upload Date" />
|
||||
<field name="name" />
|
||||
<field name="user_id" />
|
||||
|
@ -5,7 +5,7 @@
|
||||
<field name="name">ebics.userid.tree</field>
|
||||
<field name="model">ebics.userid</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="EBICS UserID" decoration-muted="state != 'active_keys'">
|
||||
<tree decoration-muted="state != 'active_keys'">
|
||||
<field name="name" />
|
||||
<field name="signature_class" />
|
||||
<field name="state" />
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Copyright 2009-2020 Noviat.
|
||||
# Copyright 2009-2022 Noviat.
|
||||
# License LGPL-3 or later (http://www.gnu.org/licenses/lpgl).
|
||||
|
||||
import logging
|
||||
@ -43,8 +43,8 @@ class EbicsChangePassphrase(models.TransientModel):
|
||||
passphrase=self.ebics_userid_id.ebics_passphrase,
|
||||
)
|
||||
keyring.change_passphrase(self.new_pass)
|
||||
except ValueError as e:
|
||||
raise UserError(str(e))
|
||||
except ValueError as err:
|
||||
raise UserError(str(err)) from err
|
||||
self.ebics_userid.ebics_passphrase = self.new_pass
|
||||
self.note = "The EBICS Passphrase has been changed."
|
||||
|
||||
|
@ -86,7 +86,6 @@ class EbicsXfer(models.TransientModel):
|
||||
"and 'FDL' for download.",
|
||||
)
|
||||
test_mode = fields.Boolean(
|
||||
string="Test Mode",
|
||||
help="Select this option to test if the syntax of "
|
||||
"the upload file is correct."
|
||||
"\nThis option is only available for "
|
||||
@ -222,8 +221,11 @@ class EbicsXfer(models.TransientModel):
|
||||
e = exc_info()
|
||||
self.note += "\n"
|
||||
self.note += _(
|
||||
"EBICS Functional Error during download of File Format %s (%s):"
|
||||
) % (df.name, df.order_type)
|
||||
"EBICS Functional Error during download of "
|
||||
"File Format %(name)s (%(order_type)s):",
|
||||
name=df.name,
|
||||
order_type=df.order_type,
|
||||
)
|
||||
self.note += "\n"
|
||||
self.note += "{} (code: {})".format(e[1].message, e[1].code)
|
||||
except EbicsTechnicalError:
|
||||
@ -231,8 +233,11 @@ class EbicsXfer(models.TransientModel):
|
||||
e = exc_info()
|
||||
self.note += "\n"
|
||||
self.note += _(
|
||||
"EBICS Technical Error during download of File Format %s (%s):"
|
||||
) % (df.name, df.order_type)
|
||||
"EBICS Technical Error during download of "
|
||||
"File Format %(name)s (%(order_type)s):",
|
||||
name=df.name,
|
||||
order_type=df.order_type,
|
||||
)
|
||||
self.note += "\n"
|
||||
self.note += "{} (code: {})".format(e[1].message, e[1].code)
|
||||
except EbicsVerificationError:
|
||||
@ -240,23 +245,31 @@ class EbicsXfer(models.TransientModel):
|
||||
self.note += "\n"
|
||||
self.note += _(
|
||||
"EBICS Verification Error during download of "
|
||||
"File Format %s (%s):"
|
||||
) % (df.name, df.order_type)
|
||||
"File Format %(name)s (%(order_type)s):",
|
||||
name=df.name,
|
||||
order_type=df.order_type,
|
||||
)
|
||||
self.note += "\n"
|
||||
self.note += _("The EBICS response could not be verified.")
|
||||
except UserError as e:
|
||||
self.note += "\n"
|
||||
self.note += _(
|
||||
"Warning during download of File Format %s (%s):"
|
||||
) % (df.name, df.order_type)
|
||||
"Warning during download of "
|
||||
"File Format %(name)s (%(order_type)s):",
|
||||
name=df.name,
|
||||
order_type=df.order_type,
|
||||
)
|
||||
self.note += "\n"
|
||||
self.note += e.name
|
||||
except Exception:
|
||||
err_cnt += 1
|
||||
self.note += "\n"
|
||||
self.note += _(
|
||||
"Unknown Error during download of File Format %s (%s):"
|
||||
) % (df.name, df.order_type)
|
||||
"Unknown Error during download of "
|
||||
"File Format %(name)s (%(order_type)s):",
|
||||
name=df.name,
|
||||
order_type=df.order_type,
|
||||
)
|
||||
tb = "".join(format_exception(*exc_info()))
|
||||
self.note += "\n%s" % tb
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user