Skip to content

Commit

Permalink
[FIX] website_sale_product_assortment: dont restrict other assortment…
Browse files Browse the repository at this point in the history
… products
  • Loading branch information
Pablocce committed Oct 15, 2024
1 parent 0041f97 commit 6229f85
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions website_sale_product_assortment/models/product_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,23 @@ def get_product_assortment_restriction_info(self, product_ids):
]
)
)
assortment_dict = {}

allowed_product_ids = set()
for assortment in assortments:
if partner & assortment.with_context(active_test=False).all_partner_ids:
allowed_product_ids = assortment.all_product_ids.ids
for product in product_ids:
if product not in allowed_product_ids:
assortment_dict.setdefault(product, self.env["ir.filters"])
assortment_dict[product] |= assortment
allowed_product_ids.update(assortment.all_product_ids.ids)

assortment_dict = {}
for product in product_ids:
if product not in allowed_product_ids:
assortment_dict.setdefault(product, self.env["ir.filters"])
for assortment in assortments:
if (
partner
& assortment.with_context(active_test=False).all_partner_ids
):
if product not in assortment.all_product_ids.ids:
assortment_dict[product] |= assortment
return assortment_dict

def _get_combination_info(
Expand Down

0 comments on commit 6229f85

Please sign in to comment.