diff --git a/setup/website_sale_product_minimal_price/odoo/addons/website_sale_product_minimal_price b/setup/website_sale_product_minimal_price/odoo/addons/website_sale_product_minimal_price new file mode 120000 index 0000000000..2f91b0a8ce --- /dev/null +++ b/setup/website_sale_product_minimal_price/odoo/addons/website_sale_product_minimal_price @@ -0,0 +1 @@ +../../../../website_sale_product_minimal_price \ No newline at end of file diff --git a/setup/website_sale_product_minimal_price/setup.py b/setup/website_sale_product_minimal_price/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/website_sale_product_minimal_price/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/website_sale_product_minimal_price/__manifest__.py b/website_sale_product_minimal_price/__manifest__.py index f135044bb3..009c04a122 100644 --- a/website_sale_product_minimal_price/__manifest__.py +++ b/website_sale_product_minimal_price/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Website Sale Product Minimal Price", "summary": "Display minimal price for products that has variants", - "version": "15.0.1.0.0", + "version": "16.0.1.0.0", "development_status": "Production/Stable", "maintainers": ["sergio-teruel"], "category": "Website", @@ -17,15 +17,11 @@ "assets": { "web.assets_frontend": [ "/web/static/src/legacy/js/fields/field_utils.js", - "/website_sale_product_minimal_price/static/src/js" - "/website_sale_product_minimal_price.js", - "/website_sale_product_minimal_price/static/src/js" - "/website_sale_product_price_scale.js", + "/website_sale_product_minimal_price/static/src/xml/*.xml", + "/website_sale_product_minimal_price/static/src/js/*.js", ], "web.assets_tests": [ - "/website_sale_product_minimal_price/static/src/js/tour.js", - "/website_sale_product_minimal_price/static/src/js" - "/test_product_with_no_prices_tour.js", + "/website_sale_product_minimal_price/static/src/js/tours/*.js" ], }, } diff --git a/website_sale_product_minimal_price/controllers/main.py b/website_sale_product_minimal_price/controllers/main.py index 5c9db94df6..081227b8b6 100644 --- a/website_sale_product_minimal_price/controllers/main.py +++ b/website_sale_product_minimal_price/controllers/main.py @@ -76,9 +76,9 @@ def get_combination_info_pricelist_atributes(self, product_id, **kwargs): ) qty_list = sorted(set(qty_list.mapped("min_quantity"))) res = [] - last_price = product.with_context(quantity=0).price + last_price = product.with_context(quantity=0)._get_contextual_price() for min_qty in qty_list: - new_price = product.with_context(quantity=min_qty).price + new_price = product.with_context(quantity=min_qty)._get_contextual_price() if new_price != last_price: res.append( { diff --git a/website_sale_product_minimal_price/models/product_template.py b/website_sale_product_minimal_price/models/product_template.py index c85ed7a954..9d0c3e4f56 100644 --- a/website_sale_product_minimal_price/models/product_template.py +++ b/website_sale_product_minimal_price/models/product_template.py @@ -73,7 +73,7 @@ def _get_cheapest_info(self, pricelist): for qty in [1, 99999999]: product_price = product.with_context( quantity=qty, pricelist=pricelist.id - ).price + )._get_contextual_price() if product_price != min_price and min_price != 99999999: # Mark if there are different prices iterating over # variants and comparing qty 1 and maximum qty diff --git a/website_sale_product_minimal_price/static/src/js/test_product_with_no_prices_tour.js b/website_sale_product_minimal_price/static/src/js/tours/test_product_with_no_prices_tour.js similarity index 100% rename from website_sale_product_minimal_price/static/src/js/test_product_with_no_prices_tour.js rename to website_sale_product_minimal_price/static/src/js/tours/test_product_with_no_prices_tour.js diff --git a/website_sale_product_minimal_price/static/src/js/tour.js b/website_sale_product_minimal_price/static/src/js/tours/tour.js similarity index 100% rename from website_sale_product_minimal_price/static/src/js/tour.js rename to website_sale_product_minimal_price/static/src/js/tours/tour.js