[IMP] partner_statement: black, isort, prettier
parent
b24cd6ca38
commit
eadd307623
|
@ -27,14 +27,14 @@ class ActivityStatementXslx(models.AbstractModel):
|
|||
account_type = data.get("account_type", False)
|
||||
row_pos += 2
|
||||
statement_header = _(
|
||||
"%sStatement between %s and %s in %s"
|
||||
% (
|
||||
account_type == "payable" and _("Supplier ") or "",
|
||||
partner_data.get("start"),
|
||||
partner_data.get("end"),
|
||||
currency.display_name,
|
||||
)
|
||||
)
|
||||
"%(payable)sStatement between %(start)s and %(end)s in %(currency)s"
|
||||
) % {
|
||||
"payable": account_type == "payable" and _("Supplier ") or "",
|
||||
"start": partner_data.get("start"),
|
||||
"end": partner_data.get("end"),
|
||||
"currency": currency.display_name,
|
||||
}
|
||||
|
||||
sheet.merge_range(
|
||||
row_pos, 0, row_pos, 6, statement_header, FORMATS["format_right_bold"]
|
||||
)
|
||||
|
@ -116,10 +116,10 @@ class ActivityStatementXslx(models.AbstractModel):
|
|||
currency_data = partner_data.get("currencies", {}).get(currency.id)
|
||||
if currency_data.get("buckets"):
|
||||
row_pos += 2
|
||||
buckets_header = _("Aging Report at %s in %s") % (
|
||||
partner_data.get("end"),
|
||||
currency.display_name,
|
||||
)
|
||||
buckets_header = _("Aging Report at %(end)s in %(currency)s") % {
|
||||
"end": partner_data.get("end"),
|
||||
"currency": currency.display_name,
|
||||
}
|
||||
sheet.merge_range(
|
||||
row_pos, 0, row_pos, 6, buckets_header, FORMATS["format_right_bold"]
|
||||
)
|
||||
|
@ -203,7 +203,7 @@ class ActivityStatementXslx(models.AbstractModel):
|
|||
0,
|
||||
row_pos,
|
||||
6,
|
||||
_("Statement of Account from %s" % (company.display_name)),
|
||||
_("Statement of Account from %s") % (company.display_name),
|
||||
FORMATS["format_ws_title"],
|
||||
)
|
||||
row_pos += 1
|
||||
|
|
|
@ -26,14 +26,12 @@ class OutstandingStatementXslx(models.AbstractModel):
|
|||
currency_data = partner_data.get("currencies", {}).get(currency.id)
|
||||
account_type = data.get("account_type", False)
|
||||
row_pos += 2
|
||||
statement_header = _(
|
||||
"%sStatement up to %s in %s"
|
||||
% (
|
||||
account_type == "payable" and _("Supplier ") or "",
|
||||
partner_data.get("end"),
|
||||
currency.display_name,
|
||||
)
|
||||
)
|
||||
statement_header = _("%(payable)sStatement up to %(end)s in %(currency)s") % {
|
||||
"payable": account_type == "payable" and _("Supplier ") or "",
|
||||
"end": partner_data.get("end"),
|
||||
"currency": currency.display_name,
|
||||
}
|
||||
|
||||
sheet.merge_range(
|
||||
row_pos, 0, row_pos, 6, statement_header, FORMATS["format_right_bold"]
|
||||
)
|
||||
|
@ -106,10 +104,11 @@ class OutstandingStatementXslx(models.AbstractModel):
|
|||
currency_data = partner_data.get("currencies", {}).get(currency.id)
|
||||
if currency_data.get("buckets"):
|
||||
row_pos += 2
|
||||
buckets_header = _("Aging Report at %s in %s") % (
|
||||
partner_data.get("end"),
|
||||
currency.display_name,
|
||||
)
|
||||
buckets_header = _("Aging Report at %(end)s in %(currency)s") % {
|
||||
"end": partner_data.get("end"),
|
||||
"currency": currency.display_name,
|
||||
}
|
||||
|
||||
sheet.merge_range(
|
||||
row_pos, 0, row_pos, 6, buckets_header, FORMATS["format_right_bold"]
|
||||
)
|
||||
|
@ -193,7 +192,7 @@ class OutstandingStatementXslx(models.AbstractModel):
|
|||
0,
|
||||
row_pos,
|
||||
6,
|
||||
_("Statement of Account from %s" % (company.display_name)),
|
||||
_("Statement of Account from %s") % (company.display_name),
|
||||
FORMATS["format_ws_title"],
|
||||
)
|
||||
row_pos += 1
|
||||
|
|
|
@ -8,7 +8,7 @@ from odoo.tests.common import TransactionCase
|
|||
|
||||
|
||||
class TestActivityStatement(TransactionCase):
|
||||
""" Tests for Activity Statement."""
|
||||
"""Tests for Activity Statement."""
|
||||
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
|
|
|
@ -5,7 +5,7 @@ from odoo.tests.common import TransactionCase
|
|||
|
||||
|
||||
class TestOutstandingStatement(TransactionCase):
|
||||
""" Tests for Outstanding Statement."""
|
||||
"""Tests for Outstanding Statement."""
|
||||
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
|
|
|
@ -23,11 +23,12 @@ class ActivityStatementWizard(models.TransientModel):
|
|||
|
||||
@api.onchange("aging_type")
|
||||
def onchange_aging_type(self):
|
||||
super().onchange_aging_type()
|
||||
res = super().onchange_aging_type()
|
||||
if self.aging_type == "months":
|
||||
self.date_start = self.date_end.replace(day=1)
|
||||
else:
|
||||
self.date_start = self.date_end - relativedelta(days=30)
|
||||
return res
|
||||
|
||||
def _prepare_statement(self):
|
||||
res = super()._prepare_statement()
|
||||
|
|
|
@ -37,7 +37,6 @@ class StatementCommon(models.AbstractModel):
|
|||
|
||||
account_type = fields.Selection(
|
||||
[("receivable", "Receivable"), ("payable", "Payable")],
|
||||
string="Account type",
|
||||
default="receivable",
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue