[14.0]black, isort, prettier

This commit is contained in:
Luc De Meyer
2022-05-10 21:40:54 +02:00
parent 503d0821d4
commit 233f719b6b
21 changed files with 1331 additions and 983 deletions

View File

@@ -2,16 +2,18 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
_FILE_FORMATS = [
{'xml_id_name': 'ebics_ff_C52',
'download_process_method': 'camt.052',
},
{'xml_id_name': 'ebics_ff_C53',
'download_process_method': 'camt.053',
},
{'xml_id_name': 'ebics_ff_FDL_camt_xxx_cfonb120_stm',
'download_process_method': 'cfonb120',
},
{
"xml_id_name": "ebics_ff_C52",
"download_process_method": "camt.052",
},
{
"xml_id_name": "ebics_ff_C53",
"download_process_method": "camt.053",
},
{
"xml_id_name": "ebics_ff_FDL_camt_xxx_cfonb120_stm",
"download_process_method": "cfonb120",
},
]
@@ -21,21 +23,22 @@ def migrate(cr, version):
def _update_file_format(cr, ff):
cr.execute(
cr.execute( # pylint: disable=E8103
"""
SELECT res_id FROM ir_model_data
WHERE module='account_ebics' AND name='{}'
""".format(ff['xml_id_name'])
""".format(
ff["xml_id_name"]
)
)
res = cr.fetchone()
if res:
cr.execute(
cr.execute( # pylint: disable=E8103
"""
UPDATE ebics_file_format
SET download_process_method='{download_process_method}'
WHERE id={ff_id};
""".format(
download_process_method=ff['download_process_method'],
ff_id=res[0]
)
download_process_method=ff["download_process_method"], ff_id=res[0]
)
)

View File

@@ -2,36 +2,45 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
_FILE_FORMATS = [
{'old_xml_id_name': 'ebics_ff_camt_052_001_02_stm',
'new_xml_id_name': 'ebics_ff_C52',
'new_name': 'camt.052',
},
{'old_xml_id_name': 'ebics_ff_camt_053_001_02_stm',
'new_xml_id_name': 'ebics_ff_C53',
'new_name': 'camt.053',
},
{'old_xml_id_name': 'ebics_ff_camt_xxx_cfonb120_stm',
'new_xml_id_name': 'ebics_ff_FDL_camt_xxx_cfonb120_stm',
},
{'old_xml_id_name': 'ebics_ff_pain_001_001_03_sct',
'new_xml_id_name': 'ebics_ff_CCT',
},
{'old_xml_id_name': 'ebics_ff_pain_001',
'new_xml_id_name': 'ebics_ff_XE2',
'new_name': 'pain.001.001.03',
},
{'old_xml_id_name': 'ebics_ff_pain_008_001_02_sdd',
'new_xml_id_name': 'ebics_ff_CDD',
},
{'old_xml_id_name': 'ebics_ff_pain_008',
'new_xml_id_name': 'ebics_ff_XE3',
},
{'old_xml_id_name': 'ebics_ff_pain_008_001_02_sbb',
'new_xml_id_name': 'ebics_ff_CDB',
},
{'old_xml_id_name': 'ebics_ff_pain_001_001_02_sct',
'new_xml_id_name': 'ebics_ff_FUL_pain_001_001_02_sct',
},
{
"old_xml_id_name": "ebics_ff_camt_052_001_02_stm",
"new_xml_id_name": "ebics_ff_C52",
"new_name": "camt.052",
},
{
"old_xml_id_name": "ebics_ff_camt_053_001_02_stm",
"new_xml_id_name": "ebics_ff_C53",
"new_name": "camt.053",
},
{
"old_xml_id_name": "ebics_ff_camt_xxx_cfonb120_stm",
"new_xml_id_name": "ebics_ff_FDL_camt_xxx_cfonb120_stm",
},
{
"old_xml_id_name": "ebics_ff_pain_001_001_03_sct",
"new_xml_id_name": "ebics_ff_CCT",
},
{
"old_xml_id_name": "ebics_ff_pain_001",
"new_xml_id_name": "ebics_ff_XE2",
"new_name": "pain.001.001.03",
},
{
"old_xml_id_name": "ebics_ff_pain_008_001_02_sdd",
"new_xml_id_name": "ebics_ff_CDD",
},
{
"old_xml_id_name": "ebics_ff_pain_008",
"new_xml_id_name": "ebics_ff_XE3",
},
{
"old_xml_id_name": "ebics_ff_pain_008_001_02_sbb",
"new_xml_id_name": "ebics_ff_CDB",
},
{
"old_xml_id_name": "ebics_ff_pain_001_001_02_sct",
"new_xml_id_name": "ebics_ff_FUL_pain_001_001_02_sct",
},
]
@@ -44,11 +53,13 @@ def migrate(cr, version):
def _update_file_format(cr, ff):
cr.execute(
cr.execute( # pylint: disable=E8103
"""
SELECT id, res_id FROM ir_model_data
WHERE module='account_ebics' AND name='{}'
""".format(ff['old_xml_id_name'])
""".format(
ff["old_xml_id_name"]
)
)
res = cr.fetchone()
if res:
@@ -59,7 +70,7 @@ def _update_file_format(cr, ff):
""".format(
new_xml_id_name=ff["new_xml_id_name"], xml_id=res[0]
)
if ff.get('new_name'):
if ff.get("new_name"):
query += """
UPDATE ebics_file_format
SET name='{new_name}'
@@ -67,4 +78,4 @@ def _update_file_format(cr, ff):
""".format(
new_name=ff["new_name"], ff_id=res[1]
)
cr.execute(query)
cr.execute(query) # pylint: disable=E8103