diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2023-06-02 10:23:05 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2023-06-02 10:23:05 +0700 |
| commit | 673e5500269f96492a447eb7ea38ed16b1827468 (patch) | |
| tree | 8c747ee01cc49c0d8e59ab816659530999c66707 | |
| parent | caae31d0376d62ca62a6d4e3fa5aaa0842fc9c88 (diff) | |
ceiling price exclude after discount
| -rw-r--r-- | indoteknik_api/models/product_product.py | 2 | ||||
| -rw-r--r-- | indoteknik_custom/models/apache_solr.py | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/indoteknik_api/models/product_product.py b/indoteknik_api/models/product_product.py index 49ea7804..7913e37e 100644 --- a/indoteknik_api/models/product_product.py +++ b/indoteknik_api/models/product_product.py @@ -139,7 +139,7 @@ class ProductProduct(models.Model): default_divide_tax = float(1.11) price_after_disc = self._get_website_price_after_disc() res = price_after_disc / default_divide_tax - res = math.floor(res) + res = math.ceil(res) return res def _get_website_price_after_disc(self): diff --git a/indoteknik_custom/models/apache_solr.py b/indoteknik_custom/models/apache_solr.py index a988a8d3..9f187d78 100644 --- a/indoteknik_custom/models/apache_solr.py +++ b/indoteknik_custom/models/apache_solr.py @@ -168,3 +168,12 @@ class ApacheSolr(models.Model): _solr.add(documents) end_time = time.time() _logger.info("[SYNC_PRODUCT_TO_SOLR] Finish task add to solr. Time taken: {:.6f} seconds".format(end_time - start_time)) + + def _test_product_price(self, product_id=228178): + product = self.env['product.product'].search([('id', '=', product_id)], limit=1) + _logger.info('price incl tax: %s' % product._get_website_price_include_tax()) + _logger.info('price excl tax: %s' % product._get_website_price_exclude_tax()) + _logger.info('discount : %s' % product._get_website_disc(0)) + _logger.info('price after discount : %s' % product._get_website_price_after_disc()) + _logger.info('price excl after discount : %s' % product._get_website_price_after_disc_and_tax()) + _logger.info('tax : %s' % product._get_website_tax()) |
