summaryrefslogtreecommitdiff
path: root/indoteknik_api/controllers
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2024-08-14 13:31:36 +0700
committerstephanchrst <stephanchrst@gmail.com>2024-08-14 13:31:36 +0700
commited089761d43b20ecc4190ca9d88a0bdb769d81f2 (patch)
tree6f5ed6967a4aa20e5773561f7a6b129d91b23311 /indoteknik_api/controllers
parent513d2b473f4fbf7245c35289e2a3215c5da556a6 (diff)
parentc091a99de4e3c3bb4f85a8b0c91d75735ebefbd4 (diff)
Merge branch 'production' into feature/calculate_selling_price
# Conflicts: # indoteknik_custom/views/website_user_cart.xml
Diffstat (limited to 'indoteknik_api/controllers')
-rw-r--r--indoteknik_api/controllers/api_v1/lead.py1
-rw-r--r--indoteknik_api/controllers/api_v1/voucher.py5
2 files changed, 6 insertions, 0 deletions
diff --git a/indoteknik_api/controllers/api_v1/lead.py b/indoteknik_api/controllers/api_v1/lead.py
index 23c3bf99..d5cc7c5c 100644
--- a/indoteknik_api/controllers/api_v1/lead.py
+++ b/indoteknik_api/controllers/api_v1/lead.py
@@ -15,6 +15,7 @@ class Lead(controller.Controller):
"file_nib": [],
"file_tdp": [],
"file_siup": [],
+ "file_quotation": [],
"description": []
})
diff --git a/indoteknik_api/controllers/api_v1/voucher.py b/indoteknik_api/controllers/api_v1/voucher.py
index 53f118ec..cd5dff20 100644
--- a/indoteknik_api/controllers/api_v1/voucher.py
+++ b/indoteknik_api/controllers/api_v1/voucher.py
@@ -20,6 +20,7 @@ class Voucher(controller.Controller):
def get_vouchers_by_user_id(self, **kw):
cart = request.env['website.user.cart']
code = kw.get('code')
+ type = kw.get('type')
user_id = int(kw.get('user_id', 0))
source = kw.get('source')
visibility = ['public']
@@ -32,6 +33,10 @@ class Voucher(controller.Controller):
if user_pricelist:
domain += [('excl_pricelist_ids', 'not in', [user_pricelist.id])]
+ if type:
+ type = type.split(',')
+ domain += [('apply_type', 'in', type)]
+
domain += [('visibility', 'in', visibility)]
vouchers = request.env['voucher'].get_active_voucher(domain)
checkout = cart.get_user_checkout(user_id, source=source)