Skip to Content
Menu
This question has been flagged
1 Atsakyti
17709 Rodiniai

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)


Portretas
Atmesti
Best Answer

@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)
Portretas
Atmesti

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

@http.route()

Related Posts Replies Rodiniai Veikla
1
bal. 24
26503
1
kov. 15
5636
1
kov. 15
4610
1
kov. 15
6543
4
lapkr. 24
2611