diff options
| -rw-r--r-- | indoteknik_custom/models/apache_solr.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/indoteknik_custom/models/apache_solr.py b/indoteknik_custom/models/apache_solr.py index 86039716..a988a8d3 100644 --- a/indoteknik_custom/models/apache_solr.py +++ b/indoteknik_custom/models/apache_solr.py @@ -27,14 +27,14 @@ class ApacheSolr(models.Model): documents = [] for stock in stocks: stock_total = int(stock.product_variant_id.product_tmpl_id.qty_stock_vendor) - dict_stock = dict({"set": stock_total}) + # dict_stock = dict({"set": stock_total}) document = { "id": int(stock.product_variant_id.product_tmpl_id.id), - "stock_total_f": dict_stock + "stock_total_f": stock_total } documents.append(document) _logger.info("[SYNC_PRODUCT_STOCK_TO_SOLR] Success Set to solr product %s" % stock.product_variant_id.product_tmpl_id.id) - _solr.add(documents) + _solr.add(documents, fieldUpdates={'stock_total_f':'set'}) def _update_rating_product_to_solr(self, limit=1000): current_time = datetime.now() |
