Skip to content

Commit

Permalink
[FIX] pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Saran440 committed Jul 18, 2024
1 parent 12d2f4c commit 8cb110a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
18 changes: 11 additions & 7 deletions budget_control/models/budget_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,10 @@ def _check_budget_control_over_consumed(self):
)
if budget_info["amount_balance"] < 0:
raise UserError(
_("Total amount in KPI {} will result in {:,.2f}").format(
line.name, budget_info["amount_balance"]
)
_(
"Total amount in KPI %(name)s will result in {:,.2f}",
name=line.name,
).format(budget_info["amount_balance"])
)

@api.onchange("use_all_kpis")
Expand Down Expand Up @@ -365,8 +366,10 @@ def _check_budget_amount(self):
):
raise UserError(
_(
"Planning amount should equal to the released amount {:,.2f} {}"
).format(rec.released_amount, rec.currency_id.symbol)
"Planning amount should equal "
"to the released amount {:,.2f} %(symbol)s",
symbol=rec.currency_id.symbol,
).format(rec.released_amount)
)
# Check plan vs intial
if (
Expand All @@ -380,8 +383,9 @@ def _check_budget_amount(self):
raise UserError(
_(
"Planning amount should be greater than "
"initial balance {:,.2f} {}"
).format(rec.amount_initial, rec.currency_id.symbol)
"initial balance {:,.2f} %(symbol)s",
symbol=rec.currency_id.symbol,
).format(rec.amount_initial)
)

def action_draft(self):
Expand Down
8 changes: 6 additions & 2 deletions budget_control/models/budget_period.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ def _check_budget_available(self, controls, budget_period):
balance_currency = self._get_balance_currency(
company, balance, doc_currency, date_commit
)
fomatted_balance = format_amount(
formatted_balance = format_amount(
self.env, balance_currency, doc_currency
)
analytic_name = Analytic.browse(analytic_id).display_name
Expand All @@ -447,7 +447,11 @@ def _check_budget_available(self, controls, budget_period):
template_lines.display_name, analytic_name
)
warnings.append(
_("{0}, will result in {1}").format(analytic_name, fomatted_balance)
_(
"%(analytic_name)s, will result in %(formatted_balance)s",
analytic_name=analytic_name,
formatted_balance=formatted_balance,
)
)
return list(set(warnings))

Expand Down

0 comments on commit 8cb110a

Please sign in to comment.