-
- Downloads
[FIX] sale,website_sale: Display extra prices with taxes included
Steps to reproduce the issue:
- Install eCommerce and Inventory module
- Go to Settings
- Ensure `Product Prices` is set to 'Tax included'
- Ensure `Variant Grid Entry` is activated
- Create a new Product as storable
- Set `Sales Price` to $1.0
- Set `Customer Taxes` to 10.00 %
- Under `Variants` tab, set 'Sales Variant Selection' to 'Order Grid Entry'
- Under `Variants` tab add an Attribute with 2 values
- Set "Price Extra" to $2.0 to one of the variants
- Go to the Shop and select the product
Issue:
The extra price badge does not include the taxes
($2.0 instead of $2.2), however the final price does.
Cause:
The price_extra field from ptav (used in the badge) does not include
the taxes.
However, when calculating the final price, we do first the sum of all
prices (including the extra prices) and then apply the taxes.
Solution:
In the template, for each 'variants', we call `_get_combination_info`
to get the variant.price_extra with taxes included/excluded
depending the `Product Prices` setting.
opw-2669871
closes odoo/odoo#80460
Signed-off-by:
Yannick Tivisse (yti) <yti@odoo.com>
Showing
- addons/sale/models/product_template.py 9 additions, 1 deletionaddons/sale/models/product_template.py
- addons/sale/tests/test_sale_product_attribute_value_config.py 11 additions, 0 deletions...ns/sale/tests/test_sale_product_attribute_value_config.py
- addons/sale/views/variant_templates.xml 8 additions, 8 deletionsaddons/sale/views/variant_templates.xml
- addons/website_sale/models/product.py 3 additions, 0 deletionsaddons/website_sale/models/product.py
- addons/website_sale/tests/test_website_sale_product_attribute_value_config.py 19 additions, 4 deletions...tests/test_website_sale_product_attribute_value_config.py
Please register or sign in to comment