From ed5101b5c731a551d73da8e30f295909d5d5a1a3 Mon Sep 17 00:00:00 2001 From: Rivo Lalaina Date: Tue, 19 Nov 2024 12:07:30 +0300 Subject: [PATCH] [IMP] [16.0] pre-commit : add black --- .pre-commit-config.yaml | 4 ++++ account_check_printing_aeroo/tests/test_check_printing.py | 1 - report_aeroo/__manifest__.py | 4 +--- report_aeroo/controllers/main.py | 3 +-- report_aeroo/controllers/portal.py | 1 - report_aeroo/namespace.py | 2 -- report_aeroo/tests/test_report_aeroo.py | 1 - report_aeroo/tests/test_report_aeroo_access.py | 1 - report_aeroo/tests/test_report_aeroo_company_eval.py | 1 - report_aeroo/tests/test_report_aeroo_lang_eval.py | 1 - report_aeroo/tests/test_report_aeroo_multi.py | 4 +++- report_aeroo_invoice/controllers/portal.py | 1 - report_aeroo_invoice/tests/test_res_config_settings.py | 1 - report_aeroo_replace_qweb/controllers/main.py | 1 - report_aeroo_replace_qweb/controllers/portal.py | 1 - 15 files changed, 9 insertions(+), 18 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 004b714..99c536a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,6 +22,10 @@ default_language_version: python: python3 node: "14.13.0" repos: + - repo: https://github.com/psf/black + rev: 22.8.0 + hooks: + - id: black - repo: https://github.com/PyCQA/flake8 rev: 3.8.3 hooks: diff --git a/account_check_printing_aeroo/tests/test_check_printing.py b/account_check_printing_aeroo/tests/test_check_printing.py index afe910c..faffb29 100644 --- a/account_check_printing_aeroo/tests/test_check_printing.py +++ b/account_check_printing_aeroo/tests/test_check_printing.py @@ -5,7 +5,6 @@ class TestCheckPrinting(TransactionCase): - @classmethod def setUpClass(cls): super().setUpClass() diff --git a/report_aeroo/__manifest__.py b/report_aeroo/__manifest__.py index d3e4306..5780c75 100644 --- a/report_aeroo/__manifest__.py +++ b/report_aeroo/__manifest__.py @@ -24,9 +24,7 @@ ], "demo": ["demo/report_sample.xml"], "assets": { - "web.assets_backend": [ - "report_aeroo/static/src/js/action_manager.js" - ], + "web.assets_backend": ["report_aeroo/static/src/js/action_manager.js"], }, "license": "GPL-3 or any later version", "installable": True, diff --git a/report_aeroo/controllers/main.py b/report_aeroo/controllers/main.py index c0dadc9..bb255be 100644 --- a/report_aeroo/controllers/main.py +++ b/report_aeroo/controllers/main.py @@ -20,7 +20,6 @@ class AerooReportController(http.Controller): - @http.route("/web/report_aeroo", type="http", auth="user") def generate_aeroo_report(self, report_id, record_ids, token, debug=False): """Generate an aeroo report. @@ -57,7 +56,7 @@ def generate_aeroo_report(self, report_id, record_ids, token, debug=False): return response except Exception as e: se = http.serialize_exception(e) - error = {'code': 200, 'message': "Odoo Server Error", 'data': se} + error = {"code": 200, "message": "Odoo Server Error", "data": se} return request.make_response(html_escape(json.dumps(error))) @staticmethod diff --git a/report_aeroo/controllers/portal.py b/report_aeroo/controllers/portal.py index 7802559..bd8c0fb 100644 --- a/report_aeroo/controllers/portal.py +++ b/report_aeroo/controllers/portal.py @@ -6,7 +6,6 @@ class Portal(CustomerPortal): - def _show_aeroo_report(self, record, template, download=False): """Show the given aeroo in the portal. diff --git a/report_aeroo/namespace.py b/report_aeroo/namespace.py index 2e4dc5e..45ab3c0 100644 --- a/report_aeroo/namespace.py +++ b/report_aeroo/namespace.py @@ -1,8 +1,6 @@ - from types import SimpleNamespace class AerooNamespace(SimpleNamespace): - def update(self, values): self.__dict__.update(values) diff --git a/report_aeroo/tests/test_report_aeroo.py b/report_aeroo/tests/test_report_aeroo.py index 351f2c3..d015997 100644 --- a/report_aeroo/tests/test_report_aeroo.py +++ b/report_aeroo/tests/test_report_aeroo.py @@ -11,7 +11,6 @@ class TestAerooReport(TransactionCase): - @classmethod def setUpClass(cls): super().setUpClass() diff --git a/report_aeroo/tests/test_report_aeroo_access.py b/report_aeroo/tests/test_report_aeroo_access.py index 489a126..24278cd 100644 --- a/report_aeroo/tests/test_report_aeroo_access.py +++ b/report_aeroo/tests/test_report_aeroo_access.py @@ -6,7 +6,6 @@ class TestAerooReportAccess(TransactionCase): - @classmethod def setUpClass(cls): super().setUpClass() diff --git a/report_aeroo/tests/test_report_aeroo_company_eval.py b/report_aeroo/tests/test_report_aeroo_company_eval.py index 2626c18..b7171f5 100644 --- a/report_aeroo/tests/test_report_aeroo_company_eval.py +++ b/report_aeroo/tests/test_report_aeroo_company_eval.py @@ -5,7 +5,6 @@ class TestAerooReportCompanyEval(TransactionCase): - @classmethod def setUpClass(cls): super().setUpClass() diff --git a/report_aeroo/tests/test_report_aeroo_lang_eval.py b/report_aeroo/tests/test_report_aeroo_lang_eval.py index 5a08162..e26b20f 100644 --- a/report_aeroo/tests/test_report_aeroo_lang_eval.py +++ b/report_aeroo/tests/test_report_aeroo_lang_eval.py @@ -5,7 +5,6 @@ class TestAerooReportLangEval(TransactionCase): - @classmethod def setUpClass(cls): super().setUpClass() diff --git a/report_aeroo/tests/test_report_aeroo_multi.py b/report_aeroo/tests/test_report_aeroo_multi.py index 5921bb7..2d9738e 100644 --- a/report_aeroo/tests/test_report_aeroo_multi.py +++ b/report_aeroo/tests/test_report_aeroo_multi.py @@ -34,7 +34,9 @@ def _render_report(self, partners): :param partners: a res.partner recordset """ - self.report.with_user(self.env.ref("base.user_demo").id)._render_aeroo(partners.ids, {}) + self.report.with_user(self.env.ref("base.user_demo").id)._render_aeroo( + partners.ids, {} + ) def test_generate_report_with_pdf_format_and_multiple_records(self): self.report.aeroo_out_format_id = self.env.ref( diff --git a/report_aeroo_invoice/controllers/portal.py b/report_aeroo_invoice/controllers/portal.py index 2b97f51..e9d8ef2 100644 --- a/report_aeroo_invoice/controllers/portal.py +++ b/report_aeroo_invoice/controllers/portal.py @@ -10,7 +10,6 @@ class PortalAccountWithAerooInvoiceReport(PortalAccount): - @http.route( ["/my/invoices/"], type="http", auth="public", website=True ) diff --git a/report_aeroo_invoice/tests/test_res_config_settings.py b/report_aeroo_invoice/tests/test_res_config_settings.py index 6ed298d..0a7dd77 100644 --- a/report_aeroo_invoice/tests/test_res_config_settings.py +++ b/report_aeroo_invoice/tests/test_res_config_settings.py @@ -5,7 +5,6 @@ class TestResConfigSettingsWithAerooReport(TransactionCase): - @classmethod def setUpClass(cls): super().setUpClass() diff --git a/report_aeroo_replace_qweb/controllers/main.py b/report_aeroo_replace_qweb/controllers/main.py index 2caa80f..49055f7 100644 --- a/report_aeroo_replace_qweb/controllers/main.py +++ b/report_aeroo_replace_qweb/controllers/main.py @@ -9,7 +9,6 @@ class ReportControllerWithAerooReplacement(ReportController): - @http.route(["/report/download"], type="http", auth="user") def report_download(self, data, token): """Dowload a replacement aeroo report instead of a qweb report. diff --git a/report_aeroo_replace_qweb/controllers/portal.py b/report_aeroo_replace_qweb/controllers/portal.py index 278cd4b..1bee5e4 100644 --- a/report_aeroo_replace_qweb/controllers/portal.py +++ b/report_aeroo_replace_qweb/controllers/portal.py @@ -6,7 +6,6 @@ class PortalAccountWithAerooInvoiceReport(CustomerPortal): - def _show_report(self, model, report_type, report_ref, download=False): """Dowload a replacement aeroo report instead of a qweb report.