diff options
| -rwxr-xr-x | indoteknik_custom/models/x_manufactures.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/indoteknik_custom/models/x_manufactures.py b/indoteknik_custom/models/x_manufactures.py index 710bfe8a..e48a5367 100755 --- a/indoteknik_custom/models/x_manufactures.py +++ b/indoteknik_custom/models/x_manufactures.py @@ -61,13 +61,16 @@ class XManufactures(models.Model): ('cache_reset_status', '=', 'reset'), ]) for manufacture in manufactures: - products = self.env['product.template'].search([ + templates = self.env['product.template'].search([ ('x_manufacture', '=', manufacture.id), ('solr_flag', '=', 1), ]) - for product in products: - product.solr_flag = 2 - _logger.info("Reset Solr Flag to 2 %s" % product.id) + for template in templates: + template.solr_flag = 2 + _logger.info("Reset Solr Flag template to 2 %s" % template.id) + for variant in template.product_variant_ids: + variant.solr_flag = 2 + _logger.info("Reset Solr Flag variant to 2 %s" % variant.id) manufacture.cache_reset_status = 'done' @api.onchange('x_name','image_promotion_1','image_promotion_2') |
