diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2023-10-06 14:22:12 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2023-10-06 14:22:12 +0700 |
| commit | 5f9c6e2837c8201ca8132f3d3d71627bf799fb6d (patch) | |
| tree | df2b9d4d0b52a6cf8d45d153dff977e04785abb2 /indoteknik_custom/models/solr | |
| parent | bb3c3c6cac4382220ae8a521e8c2162a5fe3d3e9 (diff) | |
| parent | 7a23a18a45fbd38fabc33f4e1a74d9f31e86cd60 (diff) | |
Merge branch 'production' of bitbucket.org:altafixco/indoteknik-addons into production
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 = [] |
