콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
17672 화면

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()

관련 게시물 답글 화면 활동
1
4월 24
26488
1
3월 15
5620
1
3월 15
4578
1
3월 15
6529
4
11월 24
2597