Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 14

http://localhost:8069/web/

#action=35&model=ir.module.module&view_type=kanban&cid
s=1&menu_id=5
Aquí encuentro como accesar la Base de Datos desde la línea de Comando en Python
https://pythonhosted.org/OdooRPC/
import odoorpc
# Prepare the connection to the server odoo =
odoorpc.ODOO('localhost', port=8069)
. .
# Check available databases print(odoo db list())

.
# Login odoo login('db_name', 'user', 'passwd’)

# Current user
user = odoo.env.user
.
print(user name) # name of the user connected

print(user.company_id.name) # the name of its company

# Simple 'raw' query


user_data = odoo.execute('res.users', 'read', [user.id])
print(user_data)

# Use all methods of a model


.
if 'sale.order' in odoo env:

Order = odoo.env['sale.order'] order_ids =


Order.search([])
.
for order in Order browse(order_ids):

.
print(order name) products = [line.product_id.name for line in order.order_line]
print(products)
# Update data through a record

You might also like