diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2024-02-27 13:27:39 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2024-02-27 13:27:39 +0700 |
| commit | 46a7cc5601ceab2a7a6cdf4d74e0fa26ce13ab8a (patch) | |
| tree | fd5ab4b2b4d4438cd691bdd41d6e067f510254e0 | |
| parent | ac4f111ba1605fe3891582b7fc396e740130791d (diff) | |
Fix active solr key on program line
| -rw-r--r-- | indoteknik_custom/models/solr/apache_solr_queue.py | 3 | ||||
| -rw-r--r-- | indoteknik_custom/models/solr/promotion_program_line.py | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/indoteknik_custom/models/solr/apache_solr_queue.py b/indoteknik_custom/models/solr/apache_solr_queue.py index 02ad5bb8..1b51538f 100644 --- a/indoteknik_custom/models/solr/apache_solr_queue.py +++ b/indoteknik_custom/models/solr/apache_solr_queue.py @@ -59,7 +59,8 @@ class ApacheSolrQueue(models.Model): _logger.info(f'Execute Queue: {res_model}.{function_name}() -> {res_id}') domain = [('id', '=', res_id)] - if res_model in ['product.template']: + model_incl_archive = ['product.template', 'promotion.program.line'] + if res_model in model_incl_archive: domain.append(('active', 'in', [True, False])) model_instance = self.env[res_model].search(domain) diff --git a/indoteknik_custom/models/solr/promotion_program_line.py b/indoteknik_custom/models/solr/promotion_program_line.py index b241b248..9cd226fb 100644 --- a/indoteknik_custom/models/solr/promotion_program_line.py +++ b/indoteknik_custom/models/solr/promotion_program_line.py @@ -52,7 +52,7 @@ class PromotionProgramLine(models.Model): 'free_product_ids': [x.product_id.id for x in rec.free_product_ids], 'free_products_s': json.dumps(free_products), 'total_qty_i': sum([x.qty for x in rec.product_ids] + [x.qty for x in rec.free_product_ids]), - 'active': rec.active + 'active_b': rec.active }) self.solr().add([document]) self.solr().commit() |
