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

I have an old odoo website with a form (odoo 10) and now I want to send that data to my new odoo instance (odoo 13)


The odoo 13 controller is defined as

@http.route('/web/create_data', type='http', auth='none', methods=['POST'], csrf=False)

def create_data(self, **post):


If I send form data with postman it works, but I cannot get it to work from odoo 10 controller. The controllers is called but it has no data.


Odoo 10 post code

requests.post(http://new.odoo13.si/web/create_data, data={'name': 'New name', 'data': 'Some data'}, headers={'Content-Type': 'multipart/form-data'})


What I'm doing wrong that I don't get the posted data?

Ảnh đại diện
Huỷ bỏ

Make sure your database is restricted with single database or proper redirection routed to the database

Tác giả

I cannot have database selected, because it's a controller that gets the database it needs to create records in the POST. The model is in odoo config added to server_wide_modules. If I post it directly from the form it works, if I use postman to test the post it works... I just cannot get it working with requests.post.

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 4 21
5811
0
thg 8 20
2243
0
thg 1 23
2265
1
thg 11 19
8561
3
thg 7 19
15214