From 6ed2316f6aa446bcd5bc7e6cd4d0c0a1136096dd Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Tue, 29 Aug 2023 10:41:22 +0700 Subject: 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 --- indoteknik_api/controllers/api_v1/product.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indoteknik_api/controllers/api_v1') 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 -- cgit v1.2.3