Skip to Content
Menu
This question has been flagged
3 Replies
1429 Views

Hi
i overwrite products_autocomplete route but this in not work

from odoo.addons.website_sale.controllers.main import WebsiteSale

class WebsiteSale(WebsiteSale):
@http.route('/shop/products/autocomplete', type='json', auth='public', website=True)
def products_autocomplete(self, term, options={}, **kwargs):
...
Avatar
Discard
Best Answer

Code seems fine to me. Make sure your module depends on "website_sale" module. If not, add "website_sale" module in your module's manifest file.

Also make sure that your py files are added in the __init__.py

Avatar
Discard
Best Answer

Hello,

Kindly check whether you have defined file in  __init__.py model under the controllers and check whether you have defined __init_.py inside the controller folder.

Also, check if website_sale is installed.

Thanks

Anisha Bahukhandi

Technical Content Writer

Avatar
Discard
Author Best Answer

Website_sale is depend and call in __init__

Avatar
Discard