diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2023-09-12 15:43:52 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2023-09-12 15:43:52 +0700 |
| commit | 890be59e4dadafc6e25651fcb9de20e2b24379cc (patch) | |
| tree | a699e771693a3f89633f01d1870aee11d0cb76c1 /indoteknik_custom/models/solr/product_template.py | |
| parent | 888a3ca6337a1622f4f16b98b700cdd437ab6023 (diff) | |
Sync to solr product variant solr flag 2, Sync to solr product template solr flag 2
Diffstat (limited to 'indoteknik_custom/models/solr/product_template.py')
| -rw-r--r-- | indoteknik_custom/models/solr/product_template.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/indoteknik_custom/models/solr/product_template.py b/indoteknik_custom/models/solr/product_template.py index b93d0a4f..9d714713 100644 --- a/indoteknik_custom/models/solr/product_template.py +++ b/indoteknik_custom/models/solr/product_template.py @@ -35,6 +35,13 @@ class ProductTemplate(models.Model): template_ids = self.env.context.get('active_ids', []) templates = self.search([('id', 'in', template_ids)]) templates._create_solr_queue('_sync_product_template_to_solr') + + def solr_flag_to_solr(self, limit=500): + template_products = self.search([('solr_flag', '=', 2)], limit=limit) + if template_products: + for product in template_products: + product._create_solr_queue('_sync_price_to_solr') + product.solr_flag = 1 def _sync_active_template_solr(self): for template in self: |
