Skip to content

Commit

Permalink
[IMP] website_sale_product_assortment
Browse files Browse the repository at this point in the history
  • Loading branch information
Pablocce committed Oct 21, 2024
1 parent 8650daa commit 3fb2022
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 8 additions & 1 deletion website_sale_product_assortment/controllers/website_sale.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,22 @@ def _get_products_allowed(self):
.search(
[
("is_assortment", "=", True),
("website_availability", "=", "no_show"),
"|",
("website_ids", "=", False),
("website_ids", "=", website_id),
]
)
)
no_restriction_assortments = any(
assortment.website_availability == "no_show" for assortment in assortments
)

assortment_restriction = False
allowed_product_ids = set()

if not no_restriction_assortments:
return allowed_product_ids, assortment_restriction

for assortment in assortments:
if (
# Set active_test to False to allow filtering by partners
Expand Down
1 change: 0 additions & 1 deletion website_sale_product_assortment/models/product_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def get_product_assortment_restriction_info(self, product_ids):
.search(
[
("is_assortment", "=", True),
("website_availability", "in", ["no_purchase", "no_restriction"]),
"|",
("website_ids", "=", website.id),
("website_ids", "=", False),
Expand Down

0 comments on commit 3fb2022

Please sign in to comment.