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

Hi.

I have a stand alone python code that interacts with a few variables, im wondering if there is a way to conect to OpenERP and extract those variables from sale.order.

Is it possible?, how can i do it?

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

Yes, it is possible. You can refer web services in OpenERP to do it. Link: https://doc.openerp.com/6.0/developer/6_22_XML-RPC_web_services/

Câu trả lời hay nhất

You can use openerp client lib (search for it on Github), and try this to start with:

import openerplib
connection = openerplib.get_connection(hostname="localhost", database=dbname, 
                                       login=username, password=pwd)

 sale_model = connection.get_model("sale.order")
 ids = sale_model.search([])
 for id in ids:
     so = sale_model.read(id, ["name"])
     print so
Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 3 15
4298
0
thg 3 15
4019
2
thg 3 15
9096
4
thg 4 24
2481
1
thg 5 22
4991