From e29b013cc662df1d25b4440c6c050441918ea2a4 Mon Sep 17 00:00:00 2001 From: Jasmin Solanki Date: Tue, 15 Mar 2022 16:34:13 +0530 Subject: [PATCH] [IMP] account_financial_report: black, isort, prettier --- account_financial_report/models/account_group.py | 4 ++-- .../report/abstract_report_xlsx.py | 8 ++++---- .../tests/test_journal_ledger.py | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/account_financial_report/models/account_group.py b/account_financial_report/models/account_group.py index dad94350..a7227b0d 100644 --- a/account_financial_report/models/account_group.py +++ b/account_financial_report/models/account_group.py @@ -25,7 +25,7 @@ class AccountGroup(models.Model): @api.depends("name", "parent_id.complete_name") def _compute_complete_name(self): - """ Forms complete name of location from parent location to child location. """ + """Forms complete name of location from parent location to child location.""" if self.parent_id.complete_name: self.complete_name = "{}/{}".format(self.parent_id.complete_name, self.name) else: @@ -33,7 +33,7 @@ class AccountGroup(models.Model): @api.depends("code_prefix_start", "parent_id.complete_code") def _compute_complete_code(self): - """ Forms complete code of location from parent location to child location. """ + """Forms complete code of location from parent location to child location.""" if self.parent_id.complete_code: self.complete_code = "{}/{}".format( self.parent_id.complete_code, self.code_prefix_start diff --git a/account_financial_report/report/abstract_report_xlsx.py b/account_financial_report/report/abstract_report_xlsx.py index 4fc2872e..e232efe3 100644 --- a/account_financial_report/report/abstract_report_xlsx.py +++ b/account_financial_report/report/abstract_report_xlsx.py @@ -524,7 +524,7 @@ class AbstractReportXslx(models.AbstractModel): report_data["row_pos"] += 1 def _get_currency_amt_format(self, line_object, report_data): - """ Return amount format specific for each currency. """ + """Return amount format specific for each currency.""" if "account_group_id" in line_object and line_object["account_group_id"]: format_amt = report_data["formats"]["format_amount_bold"] field_prefix = "format_amount_bold" @@ -545,7 +545,7 @@ class AbstractReportXslx(models.AbstractModel): return format_amt def _get_currency_amt_format_dict(self, line_dict, report_data): - """ Return amount format specific for each currency. """ + """Return amount format specific for each currency.""" if line_dict.get("account_group_id", False) and line_dict["account_group_id"]: format_amt = report_data["formats"]["format_amount_bold"] field_prefix = "format_amount_bold" @@ -568,7 +568,7 @@ class AbstractReportXslx(models.AbstractModel): return format_amt def _get_currency_amt_header_format(self, line_object, report_data): - """ Return amount header format for each currency. """ + """Return amount header format for each currency.""" format_amt = report_data["formats"]["format_header_amount"] if line_object.currency_id: field_name = "format_header_amount_%s" % line_object.currency_id.name @@ -586,7 +586,7 @@ class AbstractReportXslx(models.AbstractModel): return format_amt def _get_currency_amt_header_format_dict(self, line_object, report_data): - """ Return amount header format for each currency. """ + """Return amount header format for each currency.""" format_amt = report_data["formats"]["format_header_amount"] if line_object["currency_id"]: field_name = "format_header_amount_%s" % line_object["currency_name"] diff --git a/account_financial_report/tests/test_journal_ledger.py b/account_financial_report/tests/test_journal_ledger.py index e05271d5..5620f073 100644 --- a/account_financial_report/tests/test_journal_ledger.py +++ b/account_financial_report/tests/test_journal_ledger.py @@ -116,11 +116,11 @@ class TestJournalReport(AccountTestInvoicingCommon): self, res_data, expected_debit, expected_credit ): self.assertEqual( - expected_debit, sum([rec["debit"] for rec in res_data["Journal_Ledgers"]]) + expected_debit, sum(rec["debit"] for rec in res_data["Journal_Ledgers"]) ) self.assertEqual( - expected_credit, sum([rec["credit"] for rec in res_data["Journal_Ledgers"]]) + expected_credit, sum(rec["credit"] for rec in res_data["Journal_Ledgers"]) ) def check_report_journal_debit_credit_taxes( @@ -134,19 +134,19 @@ class TestJournalReport(AccountTestInvoicingCommon): for rec in res_data["Journal_Ledgers"]: self.assertEqual( expected_base_debit, - sum([tax_line["base_debit"] for tax_line in rec["tax_lines"]]), + sum(tax_line["base_debit"] for tax_line in rec["tax_lines"]), ) self.assertEqual( expected_base_credit, - sum([tax_line["base_credit"] for tax_line in rec["tax_lines"]]), + sum(tax_line["base_credit"] for tax_line in rec["tax_lines"]), ) self.assertEqual( expected_tax_debit, - sum([tax_line["tax_debit"] for tax_line in rec["tax_lines"]]), + sum(tax_line["tax_debit"] for tax_line in rec["tax_lines"]), ) self.assertEqual( expected_tax_credit, - sum([tax_line["tax_credit"] for tax_line in rec["tax_lines"]]), + sum(tax_line["tax_credit"] for tax_line in rec["tax_lines"]), ) def test_01_test_total(self):