diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-10-04 13:56:18 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-10-04 13:56:18 +0700 |
| commit | b2c16c315455f5f1f7cc60c474435c6b9e965e40 (patch) | |
| tree | 0bf9b41c152b954bf9cc05a3a747ed950e84c105 | |
| parent | f8ae554ea2fe3d9dcce59811941f63c58fdaae3c (diff) | |
Remove locale for currency format
| -rw-r--r-- | indoteknik_custom/models/voucher.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/indoteknik_custom/models/voucher.py b/indoteknik_custom/models/voucher.py index 8486fca0..a40f8c42 100644 --- a/indoteknik_custom/models/voucher.py +++ b/indoteknik_custom/models/voucher.py @@ -1,7 +1,6 @@ from odoo import models, fields, api from datetime import datetime, timedelta from odoo.exceptions import ValidationError -import locale class Voucher(models.Model): @@ -229,9 +228,8 @@ class Voucher(models.Model): def generate_detail_tnc(self): def format_currency(amount): - locale.setlocale(locale.LC_ALL, 'id_ID') - formatted_amount = locale.format("%d", amount, grouping=True) - return f'Rp{formatted_amount}' + formatted_number = '{:,.0f}'.format(amount).replace(',', '.') + return f'Rp{formatted_number}' tnc = [] if self.apply_type == 'all': |
