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

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)


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

@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)
Аватар
Відмінити

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

@http.route()

Related Posts Відповіді Переглядів Дія
1
квіт. 24
26481
1
бер. 15
5617
1
бер. 15
4578
1
бер. 15
6529
4
лист. 24
2593