diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2023-07-25 04:24:24 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2023-07-25 04:24:24 +0000 |
| commit | e933a05e9b03e489b581f27d1aa304774aafc320 (patch) | |
| tree | 4c0e32918e1ddf4e7a3e9116d3abb186ad417c7f /indoteknik_custom | |
| parent | 940054dbc1dffca75bfb81e478d5538f762009c6 (diff) | |
| parent | d454b715e7c7c31836cd525d9470b0eb3b1e7376 (diff) | |
Merged in feature/voucher-cart (pull request #67)
Feature/voucher cart
Diffstat (limited to 'indoteknik_custom')
| -rw-r--r-- | indoteknik_custom/models/voucher.py | 2 | ||||
| -rwxr-xr-x | indoteknik_custom/views/voucher.xml | 2 |
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> |
