odoo xmlrpc

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import xmlrpc.client
 
# info = xmlrpc.client.ServerProxy('http://127.0.0.1:8069/').start()
# url, db, username, password = info['host'], info['database'], info['user'], info['password']
#
# uid = common.authenticate(db, username, password, {})
url = r'http://127.0.0.1:8069'
common = xmlrpc.client.ServerProxy('{}/xmlrpc/2/common'.format(url))
# print(common.version())
uid = common.authenticate('', 'admin', 'a6eb1f184da7fb2a1213c098ebdb8cc4f6863cd6', {})
print(uid)
models = xmlrpc.client.ServerProxy('{}/xmlrpc/2/object'.format(url))
# models.execute_kw(db, uid, password, 'res.partner', 'check_access_rights', ['read'], {'raise_exception': False})
a = models.execute_kw('', uid, 'a6eb1f184da7fb2a1213c098ebdb8cc4f6863cd6', 'res.partner', 'search', [[['is_company', '=', True]]])
print(a)
 
b = models.execute_kw('', uid, 'a6eb1f184da7fb2a1213c098ebdb8cc4f6863cd6', 'res.partner', 'fields_get', [], {'attributes': ['string', 'help', 'type']})
print(b)

  

 

posted @   CrossPython  阅读(52)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 25岁的心里话
· 按钮权限的设计及实现
历史上的今天:
2019-05-01 sqlite 一些常用的句子
2019-05-01 SnackBar使用
2019-05-01 semaphore demo 并行 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
点击右上角即可分享
微信分享提示