Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
3 Відповіді
22510 Переглядів

I want to make shop page as a homepage, it is done by frontend also in Edit Menu.
but i want to hide /shop in URL.

I got this code, but not working for me properly.

# -*- coding: utf-8 -*-
from openerp import http
from openerp.addons.website.controllers.main import Website

class Website(Website):
    @http.route(auth='public')
    def index(self, data={},**kw):
        super(Website, self).index(**kw)
        return http.request.render('website_sale.products', data)

this gives error -

Error to render compiling AST
TypeError: 'NoneType' object is not callable
Template: website_sale.search
Path: /templates/t/form
Node: <form t-att-action="keep('/shop'+ ('/category/'+slug(category)) if category else None, search=0)" method="get" t-att-class="search_class">
			<t t-if="attrib_values">
				<t t-foreach="attrib_values" t-as="a">
					<input type="hidden" name="attrib" t-att-value="'%s-%s' % (a[0], a[1])" data-oe-id="751" data-oe-model="ir.ui.view" data-oe-field="arch" data-oe-xpath="/t[1]/form[1]/t[1]/t[1]/input[1]"/>
				</t>
			</t>
			<t t-call="website.website_search_box"/>
		</form>
Аватар
Відмінити
Найкраща відповідь

Hello Mahi, 

You can achieve the same without coding. 

Inside website in top menu there is menu "Page" click on that, then click on "Manage Pages".

Then inside home menu click on the setting button and change the URL to shop

https://prnt.sc/rof88k

and make sure redirect option should be disabled

https://prnt.sc/rof94w

this is how you can achieve your requirement without coding

for detailed info please refer to this video

https://drive.google.com/file/d/1dilV7zoZCjvJXYbGEywajxfmjQUeqSMF/view

Thanks

Anisha Bahukhandi

Technical Content Writer

Аватар
Відмінити

Thank you, i forgot how to do this and your video was so clear and easy.

Найкраща відповідь

How can figure Version 16 please help thanks.

Аватар
Відмінити
Найкраща відповідь

Thanks, it works!

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
0
вер. 24
945
0
груд. 16
3415
5
серп. 25
9763
Carrusel en sitios web Вирішено
2
лип. 25
928
4
черв. 25
1040