[IMP] account_financial_report: black, isort, prettier
parent
0e3da906a6
commit
e29b013cc6
|
@ -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
|
||||
|
|
|
@ -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"]
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue