Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
17662 Tampilan

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
Buang
Jawaban Terbai

@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
Buang

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

@http.route()

Post Terkait Replies Tampilan Aktivitas
1
Apr 24
26478
1
Mar 15
5613
1
Mar 15
4576
1
Mar 15
6528
4
Nov 24
2591