Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
2808 Lượt xem

Im not sure why this does not work
import xmlrpc.client
url = 'http://localhost:8069'
db = 'odoodb'
username = 'username'
password = '123456'
common = xmlrpc.client.ServerProxy('{}/xmlrpc/2/common'.format(url))
print(common.version())


# result
File "/home/tony/Documents/odoo17/custom-addons/mbi/api.py", line 13, in print(common.version()) xmlrpc.client.ProtocolError: /xmlrpc/2/common: 404 NOT FOUND>


I added these parameters to my config but the error is the same. The code works for external servers but not localhost

xmlrpc = True
xmlrpc-port = 8069






Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

I managed to figure it out. I added base to the server_wide_module parameter in my conf file.

server_wide_module=base,web

Not sure how it relates to my issue but it fixed it

Source https://github.com/Yenthe666/auto_backup/issues/122#issuecomment-479577112

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi, please check this: https://youtu.be/Cmbo2iGuTBY 
Hope it helps.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,

Upon checking the code, everything seems to be correct and when i executed the same, it give me result also.

Result:

{'server_serie': '17.0', 'server_version_info': [17, 0, 0, 'final', 0, 'e'], 'server_version': '17.0+e', 'protocol_version': 1}


Can you ensure the file has been saved and no custom codes are causing the issues.

Thanks

Ảnh đại diện
Huỷ bỏ
Tác giả

Thanks for the help. I managed to fix it. See my answer

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 10 24
2049
1
thg 4 24
2073
0
thg 9 23
1643
1
thg 6 23
2127
xmlrpc search_read Đã xử lý
1
thg 6 23
2302