[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")
|
@api.depends("name", "parent_id.complete_name")
|
||||||
def _compute_complete_name(self):
|
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:
|
if self.parent_id.complete_name:
|
||||||
self.complete_name = "{}/{}".format(self.parent_id.complete_name, self.name)
|
self.complete_name = "{}/{}".format(self.parent_id.complete_name, self.name)
|
||||||
else:
|
else:
|
||||||
|
@ -33,7 +33,7 @@ class AccountGroup(models.Model):
|
||||||
|
|
||||||
@api.depends("code_prefix_start", "parent_id.complete_code")
|
@api.depends("code_prefix_start", "parent_id.complete_code")
|
||||||
def _compute_complete_code(self):
|
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:
|
if self.parent_id.complete_code:
|
||||||
self.complete_code = "{}/{}".format(
|
self.complete_code = "{}/{}".format(
|
||||||
self.parent_id.complete_code, self.code_prefix_start
|
self.parent_id.complete_code, self.code_prefix_start
|
||||||
|
|
|
@ -524,7 +524,7 @@ class AbstractReportXslx(models.AbstractModel):
|
||||||
report_data["row_pos"] += 1
|
report_data["row_pos"] += 1
|
||||||
|
|
||||||
def _get_currency_amt_format(self, line_object, report_data):
|
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"]:
|
if "account_group_id" in line_object and line_object["account_group_id"]:
|
||||||
format_amt = report_data["formats"]["format_amount_bold"]
|
format_amt = report_data["formats"]["format_amount_bold"]
|
||||||
field_prefix = "format_amount_bold"
|
field_prefix = "format_amount_bold"
|
||||||
|
@ -545,7 +545,7 @@ class AbstractReportXslx(models.AbstractModel):
|
||||||
return format_amt
|
return format_amt
|
||||||
|
|
||||||
def _get_currency_amt_format_dict(self, line_dict, report_data):
|
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"]:
|
if line_dict.get("account_group_id", False) and line_dict["account_group_id"]:
|
||||||
format_amt = report_data["formats"]["format_amount_bold"]
|
format_amt = report_data["formats"]["format_amount_bold"]
|
||||||
field_prefix = "format_amount_bold"
|
field_prefix = "format_amount_bold"
|
||||||
|
@ -568,7 +568,7 @@ class AbstractReportXslx(models.AbstractModel):
|
||||||
return format_amt
|
return format_amt
|
||||||
|
|
||||||
def _get_currency_amt_header_format(self, line_object, report_data):
|
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"]
|
format_amt = report_data["formats"]["format_header_amount"]
|
||||||
if line_object.currency_id:
|
if line_object.currency_id:
|
||||||
field_name = "format_header_amount_%s" % line_object.currency_id.name
|
field_name = "format_header_amount_%s" % line_object.currency_id.name
|
||||||
|
@ -586,7 +586,7 @@ class AbstractReportXslx(models.AbstractModel):
|
||||||
return format_amt
|
return format_amt
|
||||||
|
|
||||||
def _get_currency_amt_header_format_dict(self, line_object, report_data):
|
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"]
|
format_amt = report_data["formats"]["format_header_amount"]
|
||||||
if line_object["currency_id"]:
|
if line_object["currency_id"]:
|
||||||
field_name = "format_header_amount_%s" % line_object["currency_name"]
|
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, res_data, expected_debit, expected_credit
|
||||||
):
|
):
|
||||||
self.assertEqual(
|
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(
|
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(
|
def check_report_journal_debit_credit_taxes(
|
||||||
|
@ -134,19 +134,19 @@ class TestJournalReport(AccountTestInvoicingCommon):
|
||||||
for rec in res_data["Journal_Ledgers"]:
|
for rec in res_data["Journal_Ledgers"]:
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
expected_base_debit,
|
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(
|
self.assertEqual(
|
||||||
expected_base_credit,
|
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(
|
self.assertEqual(
|
||||||
expected_tax_debit,
|
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(
|
self.assertEqual(
|
||||||
expected_tax_credit,
|
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):
|
def test_01_test_total(self):
|
||||||
|
|
Loading…
Reference in New Issue