Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
2781 มุมมอง

Odoo 15

I have a controller method with these details:


@http.route('/my_route/', type='http', auth='public', website=True)

def handler(self, uid_reference, **kwargs):

....


I'm trying this, but I always get 404.


http://localhost:8069/my_route/01592-051-0001


I assume it's because I'm not correctly including the name of the database I need to connect to. I tried this variant, but the result was the same


http://localhost:8069/my_path/01592-051-0001?db=my_db_name


However, if I had authenticated previously and then closed that session, there would be no problems.

What is wrong here.


Thanks in advance


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

The route only works when you give http://localhost:8069/my_route


For the route to accept http://localhost:8069/my_route/01592-051-0001  Try giving the route as mentioned below:


@http.route('/my_route/', type='http', auth='public', website=True)


def handler(self, uid_reference, **kwargs):


Hope it helps

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
Data from website with controller แก้ไขแล้ว
2
ก.ค. 24
4154
0
พ.ค. 24
1187
4
มี.ค. 24
5182
1
มี.ค. 24
1727
3
เม.ย. 24
4818