Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
17819 Zobrazení

I need to customize my module, how can i customize?

@ Http.route ('/ web / session / change_password', type = 'json', auth = "user")

def change_password (self, fields)


Avatar
Zrušit
Nejlepší odpověď

@Lokesh EM

Just import the original controller module class and create a new class that inherit from the original controller class and override the method with the new route and if you don't need to do anything else in the method override just call super.

Like:

from addons.web.controllers.main import Session
from odoo import http

class MySession(Session):
    @http.route('/web/session/change_password', type='json', auth="user")
    def change_password(self, fields):
         return super(MySession,self).change_password(fields)
Avatar
Zrušit

You can use empty decorator, if don't need to change anything there:

@http.route()

Related Posts Odpovědi Zobrazení Aktivita
1
dub 24
26672
1
bře 15
5738
1
bře 15
4726
1
bře 15
6692
4
lis 24
2801