diff options
Diffstat (limited to 'indoteknik_custom/models/solr')
| -rw-r--r-- | indoteknik_custom/models/solr/product_product.py | 4 | ||||
| -rw-r--r-- | indoteknik_custom/models/solr/product_template.py | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/indoteknik_custom/models/solr/product_product.py b/indoteknik_custom/models/solr/product_product.py index 16135e5e..31a0026d 100644 --- a/indoteknik_custom/models/solr/product_product.py +++ b/indoteknik_custom/models/solr/product_product.py @@ -84,7 +84,7 @@ class ProductProduct(models.Model): price_excl_after_disc = variant._get_website_price_after_disc_and_tax() tax = variant._get_website_tax() discount = variant._get_website_disc(0) - flashsale_data = variant._get_flashsale_price() + flashsale_data = variant.with_context(price_for="web")._get_flashsale_price() price_excl_v2 = variant._v2_get_website_price_exclude_tax() price_excl_after_disc_v2 = variant._v2_get_website_price_after_disc_and_tax() @@ -134,7 +134,7 @@ class ProductProduct(models.Model): def solr_results(self): solr_model = self.env['apache.solr'] - pricelist = self.env.user_pricelist + pricelist = self.env.context.get('user_pricelist') price_tier = pricelist.get_tier_name() results = [] diff --git a/indoteknik_custom/models/solr/product_template.py b/indoteknik_custom/models/solr/product_template.py index e39530a7..d7439bcb 100644 --- a/indoteknik_custom/models/solr/product_template.py +++ b/indoteknik_custom/models/solr/product_template.py @@ -103,7 +103,7 @@ class ProductTemplate(models.Model): tier_data = {} for variant in template.product_variant_ids: - variant_flashsale = variant._get_flashsale_price() + variant_flashsale = variant.with_context(price_for="web")._get_flashsale_price() variant_flashsale_price = variant_flashsale.get('flashsale_price', 0) flashsale_data_price = flashsale_data.get('flashsale_price', 0) @@ -157,7 +157,7 @@ class ProductTemplate(models.Model): def solr_results(self, detail=False): solr_model = self.env['apache.solr'] - pricelist = self.env.user_pricelist + pricelist = self.env.context.get('user_pricelist') price_tier = pricelist.get_tier_name() results = [] |
