Odoo Ajuda

0

0
2 Respostas
0
Avatar

Tintuk Tomin Índia

--Tintuk Tomin--

922
| 2 2 4
MUTTOM THODUPUZHA, Índia
--Tintuk Tomin--
Tintuk Tomin Índia
21/05/19 06:25

The below code should is the xml code


<template id="new_link" name="New Link" inherit_id="website_portal.portal_layout" priority="25">
    <xpath expr="//ul[contains(@class,'o_portal_submenu')]" position="inside">
        <li>
            <a href="/my/newlink">New Menu</a>
        </li>
    </xpath>
</template>


The above code is used to create a new menu in the portal view of odoo 10. Also you want to create a new python function in the controller for creating the action. What to do on clicking on this new menu, with the link /my/newlink


For example

class CustomerPortal(CustomerPortal):

    @http.route(['/my/newlink', '/my/quotes/page/<int:page>'], type='http', auth="user", website=True)
    def portal_my_records(self, page=1, date_begin=None, date_end=None, sortby=None, **kw):
        
        print("IN PYTHON CONTROLLER")
        data={}
        return request.render("call.template", data)

When you click on the New menu in the portal page the python function will execute. and from here you can pass the controll to another template. in the above code call.template is the template name and data is the values that you need to pass into that particular template.


If you want to create a new menu in the portal page of odoo 11 refer the below link.

https://stackoverflow.com/questions/52733625/how-to-add-my-custom-menu-to-the-portal-users-menu-list



0
FG Alemanha
21/05/19 04:47

typo orderr maybe. If you have an order as in <t t-if="orders"> you still have no orderr and nothing is displayed

Faça uma Pergunta
Writer
Keep Informed
1 seguidor (es)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now