summaryrefslogtreecommitdiff
path: root/indoteknik_custom
diff options
context:
space:
mode:
Diffstat (limited to 'indoteknik_custom')
-rw-r--r--indoteknik_custom/models/voucher.py2
-rwxr-xr-xindoteknik_custom/views/voucher.xml2
2 files changed, 2 insertions, 2 deletions
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
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 @@
<field name="end_time" required="1"/>
<field name="limit" required="1"/>
<field name="manufacture_ids" widget="many2many_tags"/>
- <field name="excl_pricelist_ids" widget="many2many_tags"/>
+ <field name="excl_pricelist_ids" widget="many2many_tags" domain="[('id', 'in', [4, 15037, 15038, 15039])]"/>
</group>
</group>
<notebook>