main
parent
52695f10d9
commit
149778d30b
@ -0,0 +1,27 @@ |
||||
# -*- coding: utf-8 -*- |
||||
import xmlrpc.client |
||||
import os |
||||
import sys |
||||
import time |
||||
from datetime import datetime, timedelta |
||||
|
||||
# Odoo 连接配置 |
||||
ODOO_URL = "http://192.168.31.41:32000" |
||||
DB_NAME = "quantify" |
||||
USERNAME = "rpc" |
||||
PASSWORD = "aaaAAA111" |
||||
|
||||
# RPC 客户端 |
||||
common = xmlrpc.client.ServerProxy('{}/xmlrpc/2/common'.format(ODOO_URL)) |
||||
uid = common.authenticate(DB_NAME, USERNAME, PASSWORD, {}) |
||||
|
||||
# 搜索 alpha.expression.line 模型, 条件 字段 performance 不为空, 并按 id 升序排序 |
||||
domain = [('performance', '!=', False)] |
||||
order = 'id asc' |
||||
expression_line_ids = xmlrpc.client.ServerProxy('{}/xmlrpc/2/object'.format(ODOO_URL)).execute_kw( |
||||
DB_NAME, uid, PASSWORD, 'alpha.expression.line', 'search_read', |
||||
[domain, ['id', 'performance', 'name', 'expression_id']], |
||||
{'order': order} |
||||
) |
||||
|
||||
print(expression_line_ids) |
||||
Loading…
Reference in new issue