/ Published in: Python
Example of creation of a partner and his address.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
import xmlrpclib sock = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/object') uid = 1 pwd = 'demo' partner = { 'title': 'Monsieur', 'name': 'Fabien Pinckaers', 'lang': 'fr', 'active': True, } partner_id = sock.execute(dbname, uid, pwd, 'res.partner', 'create', partner) address = { 'partner_id': partner_id, 'type': 'default', 'street': 'Rue du vieux chateau, 21', 'zip': '1457', 'city': 'Walhain', 'phone': '(+32)10.68.94.39', 'fax': '(+32)10.68.94.39', } sock.execute(dbname, uid, pwd, 'res.partner.address', 'create', address)
URL: http://doc.openerp.com/developer/6_22_XML-RPC_web_services/