Skip to content

Commit

Permalink
[16.0][MIG]website_sale_product_minimal_price: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sbiosca-s73 committed Oct 16, 2023
1 parent 5ba23ff commit 30b0aa6
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 11 deletions.
6 changes: 6 additions & 0 deletions setup/website_sale_product_minimal_price/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
12 changes: 4 additions & 8 deletions website_sale_product_minimal_price/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
],
},
}
4 changes: 2 additions & 2 deletions website_sale_product_minimal_price/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 30b0aa6

Please sign in to comment.