Openerp Odoo如何使用XML创建或更新记录

Openerp Odoo如何使用XML创建或更新记录,openerp,xml-rpc,odoo,Openerp,Xml Rpc,Odoo,我已经阅读了创建新记录的Odoo文档。它使用XML RPC final Integer id = (Integer)models.execute("execute_kw", asList( db, uid, password, "res.partner", "create", asList(new HashMap() {{ put("name", "New Partner"); }}) )); 所以,是否可以仅使用XML消息创建新记录 谢谢。是的,这是可能的。这是你的电话号码 下面是一个仅使用

我已经阅读了创建新记录的Odoo文档。它使用XML RPC

final Integer id = (Integer)models.execute("execute_kw", asList(
db, uid, password,
"res.partner", "create",
asList(new HashMap() {{ put("name", "New Partner"); }})
));
所以,是否可以仅使用XML消息创建新记录


谢谢。

是的,这是可能的。这是你的电话号码

下面是一个仅使用python文件创建客户记录的示例

import xmlrpclib

username = 'admin' #the user
pwd = 'admin'      #the password of the user
dbname = 'odoo'    #the database

# Get the uid
sock_common = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/common')
uid = sock_common.login(dbname, username, pwd)

#replace localhost with the address of the server
sock = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/object')

partner = {
   'name': 'atul arvind',
   'phone': '8000111234'
}

partner_id = sock.execute(dbname, uid, pwd, 'res.partner', 'create', partner)
它将返回新创建的记录的id


希望有帮助。

嗨,谢谢你的回复。但我想使用纯XML消息,因为我没有使用任何编程语言。那么,用于插入或更新记录的XML消息是什么呢?谢谢。没有任何编程语言?你想开发什么?嗨,实际上我正在将Odoo与其他ERP集成,在那里我可以使用XML消息从其他ERP系统添加或更新Odoo中的主数据。那么,要在Odoo中插入或更新记录的示例XML消息是什么呢?