Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
3
3adentaire_account
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Le Filament
3A Dentaire
3adentaire_account
Commits
ac134e04
Commit
ac134e04
authored
3 years ago
by
Benjamin - Le Filament
Browse files
Options
Downloads
Patches
Plain Diff
[debug] revert debug
parent
9f31b5fc
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
models/__init__.py
+0
-1
0 additions, 1 deletion
models/__init__.py
models/ebics_xfer.py
+0
-141
0 additions, 141 deletions
models/ebics_xfer.py
with
0 additions
and
142 deletions
models/__init__.py
+
0
−
1
View file @
ac134e04
...
...
@@ -3,4 +3,3 @@
from
.
import
account
from
.
import
sale
from
.
import
ebics_xfer
This diff is collapsed.
Click to expand it.
models/ebics_xfer.py
deleted
100644 → 0
+
0
−
141
View file @
9f31b5fc
# Copyright 2020 Le Filament
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
import
base64
import
logging
import
os
from
sys
import
exc_info
from
traceback
import
format_exception
from
odoo
import
api
,
fields
,
models
,
_
from
odoo.exceptions
import
UserError
from
odoo.tools
import
config
_logger
=
logging
.
getLogger
(
__name__
)
try
:
import
fintech
from
fintech.ebics
import
EbicsKeyRing
,
EbicsBank
,
EbicsUser
,
EbicsClient
,
\
EbicsFunctionalError
,
EbicsTechnicalError
,
EbicsVerificationError
fintech
.
cryptolib
=
'
cryptography
'
except
ImportError
:
EbicsBank
=
object
_logger
.
warning
(
'
Failed to import fintech
'
)
fintech_register_name
=
config
.
get
(
'
fintech_register_name
'
)
fintech_register_keycode
=
config
.
get
(
'
fintech_register_keycode
'
)
fintech_register_users
=
config
.
get
(
'
fintech_register_users
'
)
class
EbicsXfer
(
models
.
TransientModel
):
_inherit
=
'
ebics.xfer
'
@api.multi
def
ebics_download
(
self
):
self
.
ensure_one
()
self
.
ebics_config_id
.
_check_ebics_files
()
ctx
=
self
.
_context
.
copy
()
_logger
.
info
(
fintech_register_name
)
_logger
.
info
(
fintech_register_keycode
)
_logger
.
info
(
fintech_register_users
)
self
.
note
=
''
client
=
self
.
_setup_client
()
_logger
.
info
(
client
)
if
client
:
download_formats
=
(
self
.
format_id
or
self
.
ebics_config_id
.
ebics_file_format_ids
.
filtered
(
lambda
r
:
r
.
type
==
'
down
'
)
)
ebics_files
=
self
.
env
[
'
ebics.file
'
]
date_from
=
self
.
date_from
and
self
.
date_from
.
isoformat
()
or
None
date_to
=
self
.
date_to
and
self
.
date_to
.
isoformat
()
or
None
for
df
in
download_formats
:
try
:
success
=
False
if
df
.
order_type
==
'
FDL
'
:
_logger
.
info
(
"
Download FDL
"
)
_logger
.
info
(
df
)
data
=
client
.
FDL
(
df
.
name
,
date_from
,
date_to
)
_logger
.
info
(
"
Data FDL
"
)
_logger
.
info
(
data
)
else
:
params
=
None
if
date_from
and
date_to
:
params
=
{
'
DateRange
'
:
{
'
Start
'
:
date_from
,
'
End
'
:
date_to
,
}}
data
=
client
.
download
(
df
.
order_type
,
params
=
params
)
ebics_files
+=
self
.
_handle_download_data
(
data
,
df
)
success
=
True
except
EbicsFunctionalError
:
_logger
.
info
(
"
EbicsFunctionalError
"
)
e
=
exc_info
()
_logger
.
info
(
e
)
self
.
note
+=
'
\n
'
self
.
note
+=
_
(
"
EBICS Functional Error during download of File Format %s (%s):
"
)
%
(
df
.
name
,
df
.
order_type
)
self
.
note
+=
'
\n
'
self
.
note
+=
'
%s (code: %s)
'
%
(
e
[
1
].
message
,
e
[
1
].
code
)
except
EbicsTechnicalError
:
_logger
.
info
(
"
EbicsTechnicalError
"
)
e
=
exc_info
()
_logger
.
info
(
e
)
self
.
note
+=
'
\n
'
self
.
note
+=
_
(
"
EBICS Technical Error during download of File Format %s (%s):
"
)
%
(
df
.
name
,
df
.
order_type
)
self
.
note
+=
'
\n
'
self
.
note
+=
'
%s (code: %s)
'
%
(
e
[
1
].
message
,
e
[
1
].
code
)
except
EbicsVerificationError
:
self
.
note
+=
'
\n
'
self
.
note
+=
_
(
"
EBICS Verification Error during download of
"
"
File Format %s (%s):
"
)
%
(
df
.
name
,
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
)
self
.
note
+=
'
\n
'
self
.
note
+=
e
.
name
except
Exception
:
self
.
note
+=
'
\n
'
self
.
note
+=
_
(
"
Unknown Error during download of File Format %s (%s):
"
)
%
(
df
.
name
,
df
.
order_type
)
tb
=
''
.
join
(
format_exception
(
*
exc_info
()))
self
.
note
+=
'
\n
%s
'
%
tb
else
:
# mark received data so that it is not included in further
# downloads
trans_id
=
client
.
last_trans_id
client
.
confirm_download
(
trans_id
=
trans_id
,
success
=
success
)
ctx
[
'
ebics_file_ids
'
]
=
ebics_files
.
_ids
if
ebics_files
:
self
.
note
+=
'
\n
'
for
f
in
ebics_files
:
self
.
note
+=
_
(
"
EBICS File
'
%s
'
is available for further processing.
"
)
%
f
.
name
self
.
note
+=
'
\n
'
result_view
=
self
.
env
.
ref
(
'
account_ebics.ebics_xfer_view_form_result
'
)
return
{
'
name
'
:
_
(
'
EBICS file transfer result
'
),
'
res_id
'
:
self
.
id
,
'
view_type
'
:
'
form
'
,
'
view_mode
'
:
'
form
'
,
'
res_model
'
:
'
ebics.xfer
'
,
'
view_id
'
:
result_view
.
id
,
'
target
'
:
'
new
'
,
'
context
'
:
ctx
,
'
type
'
:
'
ir.actions.act_window
'
,
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment