diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-10-24 17:07:43 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-10-24 17:07:43 +0700 |
| commit | da1ba5223456e4c39d11a5af67968dda6d569c6b (patch) | |
| tree | 310eaa29f5982767e6685c2ca263f24fba72645e /indoteknik_api/controllers/api_v1/product.py | |
| parent | 646f9557c101bd6b8ed81fc46130e9761957b5c1 (diff) | |
| parent | 1934b5ca55840deb2a4369ef6ab0affd86e2ba8f (diff) | |
Merge commit '1934b5ca55840deb2a4369ef6ab0affd86e2ba8f'
Diffstat (limited to 'indoteknik_api/controllers/api_v1/product.py')
| -rw-r--r-- | indoteknik_api/controllers/api_v1/product.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/indoteknik_api/controllers/api_v1/product.py b/indoteknik_api/controllers/api_v1/product.py index 0d5d89b6..d667c1b6 100644 --- a/indoteknik_api/controllers/api_v1/product.py +++ b/indoteknik_api/controllers/api_v1/product.py @@ -40,6 +40,14 @@ class Product(controller.Controller): if categories: query.append(('public_categ_ids', 'child_of', [int(x) for x in categories.split(',')])) + + price_from = kw.get('price_from') + if price_from and int(price_from): + query.append(('web_price_sorting', '>=', int(price_from))) + + price_to = kw.get('price_to') + if price_to and int(price_to): + query.append(('web_price_sorting', '<=', int(price_to))) product_variants = request.env['product.product'].search(query) product_variant_ids = [x.id for x in product_variants] |
