From e24789e8df500f47e6d1df28e3c656874709eb70 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Tue, 25 Jul 2023 11:22:19 +0700 Subject: Bug fix calculate discount function on voucher --- indoteknik_custom/models/voucher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indoteknik_custom') diff --git a/indoteknik_custom/models/voucher.py b/indoteknik_custom/models/voucher.py index b3a55499..a7151398 100644 --- a/indoteknik_custom/models/voucher.py +++ b/indoteknik_custom/models/voucher.py @@ -107,7 +107,7 @@ class Voucher(models.Model): if self.discount_type == 'percentage': discount = price * self.discount_amount / 100 max_disc = self.max_discount_amount - return max_disc if discount > max_disc else discount + return discount if max_disc == 0 else min(discount, max_disc) return 0 -- cgit v1.2.3 From d454b715e7c7c31836cd525d9470b0eb3b1e7376 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Tue, 25 Jul 2023 11:23:23 +0700 Subject: Add domain excl_pricelists on voucher menu --- indoteknik_custom/views/voucher.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indoteknik_custom') diff --git a/indoteknik_custom/views/voucher.xml b/indoteknik_custom/views/voucher.xml index c6741a8d..0bafcd55 100755 --- a/indoteknik_custom/views/voucher.xml +++ b/indoteknik_custom/views/voucher.xml @@ -59,7 +59,7 @@ - + -- cgit v1.2.3