diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2023-11-25 02:42:37 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2023-11-25 02:42:37 +0000 |
| commit | 4dcd1e3e1a3e4dced5a2d0d89d2fd4ee3e1fe7d3 (patch) | |
| tree | 3e15c66065c81eead3fb40c9f87e3f2c269e20f2 /indoteknik_custom/models/solr/product_product.py | |
| parent | 2aee5a44abbe36961dfe23cc3d656aa48e11e0f9 (diff) | |
| parent | 693e78afa8b9b4df99f417392b42bff12ea41f9e (diff) | |
Merged in production (pull request #132)
Production
Diffstat (limited to 'indoteknik_custom/models/solr/product_product.py')
| -rw-r--r-- | indoteknik_custom/models/solr/product_product.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/indoteknik_custom/models/solr/product_product.py b/indoteknik_custom/models/solr/product_product.py index 03eaaf13..fe2a08dc 100644 --- a/indoteknik_custom/models/solr/product_product.py +++ b/indoteknik_custom/models/solr/product_product.py @@ -29,6 +29,12 @@ class ProductProduct(models.Model): product.product_tmpl_id._create_solr_queue('_sync_price_to_solr') product.solr_flag = 1 + @api.constrains('active') + def _constrains_active(self): + for rec in self: + if not rec.active: + rec.unpublished = True + def _sync_variants_to_solr(self): solr_model = self.env['apache.solr'] |
