You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
831 B
27 lines
831 B
# -*- 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) |