[IMP] account_ebics: pre-commit auto fixes

This commit is contained in:
Luc De Meyer
2024-01-26 19:13:24 +01:00
parent d27ff618d5
commit e22fb104ea
8 changed files with 19 additions and 25 deletions

View File

@@ -8,7 +8,6 @@ from openupgradelib import openupgrade # pylint: disable=W7936
@openupgrade.migrate()
def migrate(env, version):
_ebics_config_upgrade(env, version)
_noupdate_changes(env, version)

View File

@@ -27,9 +27,7 @@ def _update_file_format(cr, ff):
"""
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:

View File

@@ -57,9 +57,7 @@ def _update_file_format(cr, ff):
"""
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:
@@ -67,15 +65,11 @@ def _update_file_format(cr, ff):
UPDATE ir_model_data
SET name='{new_xml_id_name}'
WHERE id={xml_id};
""".format(
new_xml_id_name=ff["new_xml_id_name"], xml_id=res[0]
)
""".format(new_xml_id_name=ff["new_xml_id_name"], xml_id=res[0])
if ff.get("new_name"):
query += """
UPDATE ebics_file_format
SET name='{new_name}'
WHERE id={ff_id};
""".format(
new_name=ff["new_name"], ff_id=res[1]
)
""".format(new_name=ff["new_name"], ff_id=res[1])
cr.execute(query) # pylint: disable=E8103