Skip to content

Commit 63f9128

Browse files
committed
[REF] account_compensate_advance: name_get display info Total and Balance
1 parent 6b4dac5 commit 63f9128

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

account_compensate_advance/models/account_move_line.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
33
# flake8: noqa: B950
44

5-
import locale
6-
75
from odoo import _, models
86

97

@@ -16,7 +14,6 @@ def name_get(self):
1614
Override the name_get method to customize the display name of records based on the context.
1715
"""
1816
context = self._context or {}
19-
locale.setlocale(locale.LC_ALL, self.env.user.lang)
2017

2118
# Customize name display for 'advance_id' based on context
2219
if "advance_id_name_get" in context and context["advance_id_name_get"]:
@@ -27,8 +24,8 @@ def name_get(self):
2724
name = (
2825
f"{rec.name} | "
2926
f"{_('Date')}: {rec.move_id.date.strftime('%x')} | "
30-
f"{_('Total')}: {locale.format_string('%.2f', abs(rec.price_total), grouping=True)} | "
31-
f"{balance_str}: {locale.format_string('%.2f', abs(rec.amount_residual), grouping=True)}"
27+
f"{_('Total')}: {format(abs(rec.price_total), '.2f')} | "
28+
f"{balance_str}: {format(abs(rec.amount_residual), '.2f')}"
3229
)
3330
result.append((rec.id, name))
3431
return result
@@ -41,7 +38,7 @@ def name_get(self):
4138
name = (
4239
f"{rec.name or rec.move_id.name} | "
4340
f"{_('Date')}: {rec.date_maturity.strftime('%x')} | "
44-
f"{_('Total')}: {locale.format_string('%.2f', abs(rec.price_total), grouping=True)}"
41+
f"{_('Total')}: {format(abs(rec.price_total), '.2f')}"
4542
)
4643
result.append((rec.id, name))
4744
return result

0 commit comments

Comments
 (0)