summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/voucher.py
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-10-09 11:16:39 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-10-09 11:16:39 +0700
commit070656b5a8c7a304810af193bc79ff324503db01 (patch)
treedda2f2859356e04c51478ce51bd2bdbd9f04564f /indoteknik_custom/models/voucher.py
parent19e0be70679ed862453fedeba14fb4cdf02232e9 (diff)
parenta48ae105c865e710227e12b666fa601a326d12a7 (diff)
Merge branch 'production' into change/feature/promotion-program
Diffstat (limited to 'indoteknik_custom/models/voucher.py')
-rw-r--r--indoteknik_custom/models/voucher.py6
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':