Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

External Python code calling (xml-rpc maybe?) Openerp Fields to work with

By
Hana88
on 9/24/13, 10:31 AM 1,291 views

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?

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/

OpenERP Vietnam
on 9/24/13, 4:10 PM
1
martin mueller
On 9/24/13, 10:57 PM

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 9/24/13, 10:31 AM
Seen: 1291 times
Last updated: 3/16/15, 8:10 AM