summaryrefslogtreecommitdiff
path: root/indoteknik_api/controllers/api_v1
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-08-29 10:41:22 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-08-29 10:41:22 +0700
commit6ed2316f6aa446bcd5bc7e6cd4d0c0a1136096dd (patch)
tree62e6556b8c7fa6fd6f6085b3b3e6ef00b78ee713 /indoteknik_api/controllers/api_v1
parent315b832420eb8314e809b1c0f549304d423b45f3 (diff)
Update apache solr
- Create get tier name pricelist - Create solr results on product.template and product.product - Fix get active flash sale on product template - Update name "get_single_doc" to "get_doc" in apache solr model - Add product ids on sync category homepage to solr
Diffstat (limited to 'indoteknik_api/controllers/api_v1')
-rw-r--r--indoteknik_api/controllers/api_v1/product.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/indoteknik_api/controllers/api_v1/product.py b/indoteknik_api/controllers/api_v1/product.py
index 98e131da..e3b7701a 100644
--- a/indoteknik_api/controllers/api_v1/product.py
+++ b/indoteknik_api/controllers/api_v1/product.py
@@ -360,6 +360,9 @@ class Product(controller.Controller):
categories = solr_model.connect('product_category_homepage').search(query, sort='sequence_i asc').docs
categories = solr_model.clean_key_docs(categories)
for category in categories:
- category['products'] = json.loads(category['products'])
+ product_ids = category.get('product_ids', [])
+ category.pop('product_ids', None)
+ products = request.env['product.template'].browse(product_ids)
+ category['products'] = products.solr_results()
return self.response(categories, headers=[('Cache-Control', 'max-age=3600, public')]) \ No newline at end of file