Skip to content

Commit

Permalink
[IMP] website_sale_product_assortment
Browse files Browse the repository at this point in the history
  • Loading branch information
SuShanVoong committed Feb 17, 2025
1 parent e016f16 commit 7e9186b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions website_sale_product_assortment/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
from . import variant
from . import website_sale
from . import main
27 changes: 27 additions & 0 deletions website_sale_product_assortment/controllers/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from odoo import http

from odoo.addons.website.controllers import main

from .website_sale import WebsiteSale


class Website(main.Website):
@http.route()
def autocomplete(
self,
options=None,
**kwargs,
):
(

Check warning on line 15 in website_sale_product_assortment/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

website_sale_product_assortment/controllers/main.py#L15

Added line #L15 was not covered by tests
allowed_product_ids,
assortment_restriction,
) = WebsiteSale()._get_products_allowed()
if assortment_restriction:
options["allowed_product_domain"] = [

Check warning on line 20 in website_sale_product_assortment/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

website_sale_product_assortment/controllers/main.py#L20

Added line #L20 was not covered by tests
("product_variant_ids", "in", list(allowed_product_ids))
]
values = super().autocomplete(

Check warning on line 23 in website_sale_product_assortment/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

website_sale_product_assortment/controllers/main.py#L23

Added line #L23 was not covered by tests
options=options,
**kwargs,
)
return values

Check warning on line 27 in website_sale_product_assortment/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

website_sale_product_assortment/controllers/main.py#L27

Added line #L27 was not covered by tests

0 comments on commit 7e9186b

Please sign in to comment.